int doubles (int d);
int minimum (int m, int n);
int oddEven (int a);
int main ()
{
int num, i, sum=0, num1, num2;
for (i=0; i<5; i++)
{
cout<<"please enter a number. ";
cin>>num;
cout<<endl;
sum= sum + num;
}
cout<<"the numbers added together is "<<sum<<endl;
cout<<"the sum of the 5 numbers doubled is "<<doubles(sum)<<endl;
cout<<endl;
int oOrE=oddEven(sum);
if (oOrE == -1)
cout<<"the sum is odd"<<endl;
else
cout<<"the sum is even"<<endl;
cout<<"please enter a number. ";
cin>>num1;
cout<<endl;
cout<<"please enter a number. ";
cin>>num2;
cout<<endl;
cout<<"the minimun of the two numbers is "<<minimum(num1, num2)<<endl;
return 0;
}
int doubles (int d)
{
d=d*2;
return d;
}
int minimum (int m, int n)
{
int mini;
if (m<n)
mini=m;
else
mini=n;
return mini;
}
int oddEven (int a)
{
int oE;
if (a%2!=0)//odd
oE= -1;
else
oE=1;
return oE;
}
*/
computers08 0 Newbie Poster
hammerhead 19 Posting Whiz in Training
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Salem 5,199 Posting Sage
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.