//test 2
#include <iostream>
using namespace std;
int largest ( int a, int b, int c)
{
if(a>b && a>c )
return a;
else
if(b>a && b>c )
return b;
else
if(c>a && c>b )
return c;
}
int compareThree ( int a, int b, int c)
{
if(a>b && a>c )
return a;
else
if(b>a && b>c )
return b;
else
if(c>a && c>b )
return c;
}
int main ()
{
int a,b,c ;
int number=1;
while ( number <4)
{
cout<<"Enter num"<<number<<":";
cin>>a,b,c;
++number;
}
cout<<largest(a,b,c);
system("pause");
return 0;
}
Here is my code.Anyone can help ??Thank you very much!
cin>>a,b,c;
is the problem line
Last edited on
Hi Dstrayex,
Can i cout num 1
num 2
num 3
means i can loop the num there ? using while ( number < 4)
Hi AndroidZ.
how to write the cin ?
The way you were looping it was making you input 3 values for each variable instead of just 1.
And Androidz means that part is wrong because you used commas ,
instead of the input operator >>
.