>>which has two int parameters and returns nothing
>if a is larger than b return a, else return b
Um, no. If a is larger than b you print a, otherwise print b.
>p.s i get mixed up with the < and > operators cant remember which one means which
This is grade school mathematics, < means less than and > means greater than. Didn't anyone ever teach you the alligator rule? The alligator always wants to eat the biggest number:
a < b // b is bigger than a, eat b
a > b // a is bigger than b, eat a
void printLarger ( int a , int b )
{
if ( a > b )
cout<< a <<endl;
else
cout<< b <<endl;
}
Alternatively:
void printLarger ( int a , int b )
{
if ( a < b )
cout<< b <<endl;
else
cout<< a <<endl;
}
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401