Enclose blocks of code corresponding to an if statement within braces { }.
This
if(input1 > input2 && input2 > input3)
cout << endl;
cout << input1 << endl;
cout << input2 << endl;
cout << input3 << endl;
means this
if(input1 > input2 && input2 > input3)
{
cout << endl;
}
cout << input1 << endl;
cout << input2 << endl;
cout << input3 << endl;
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
you aren't allowed to use qsort?
JayseR seemed to make it clear that s/he is new. And doesn't qsort seem like extreme overkill for three values?
int compar(int *a, int *b)
{
return (*a>*b);
}
The comparison function forqsort should be declared like this.
int compar(const void*, const void*);
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314