#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int num1, num2, num3;
int a, b, c;
int greater;
cout << "input your first number: ";
cin >> num1;
cout << endl;
cout << "input your second number: ";
cin >> num2;
cout << endl;
cout << "input your third number: ";
cin >> num3;
cout << endl;
if (num1 > num2 && num3)
cout << num1 << endl;
else if (num2 > num3)
cout << num2 << endl;
else if (num2 > num1)
cout << num2 << endl;
else if (num3 > num1)
cout << num3 << endl;
else if (num3 > num2)
cout << num3 << endl;
if (num2 > num1 && num3)
cout << num2 << endl;
else if (num3 > num2)
cout << num3 << endl;
else if (num3 > num1)
cout << num3 << endl;
else if (num1 > num3)
cout << num1 << endl;
else if (num1 > num2)
cout << num1 << endl;
if (num3 > num1 && num2)
cout << num3 << endl;
else if (num2 > num1)
cout << num2 << endl;
else if (num2 > num3)
cout << num2 << endl;
else if (num1 > num2)
cout << num1 << endl;
else if (num1 > num3)
cout << num1 << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
the issue im having now is that lets say that num1 is smaller than num2 but not num3, the program sees that num1 is not greater than num2 and num3 and prints num2 or num3, whatever comes first in the program. It does this for each block of code.
What I really wanted to do is use >! inside an IF statement: if (num1 > num2 && num1 < num3)
but it doesn't seem to work like that =(
im proboly going to work on other stuff tomorrow (business communications) since it needs to be in by Monday and other than this one program im a week ahead in programming
No comments:
Post a Comment