I wrote this program and it seems to work but I found out its only comparing the first two numbers. I need it to compare all five...what am I doing wrong now..I know its something with the if (A > E) statement.
Bryan
Code:#include <iostream>
using namespace std;
int main()
{
float A;
float B;
float C;
float D;
float E;
cout << "Enter 1st Interger then press enter:" << endl;
cin >> A;
cout << "Enter 2nd Interger then press enter:" << endl;
cin >> B;
cout << "Enter 3rd Interger then press enter:" << endl;
cin >> C;
cout << "Enter 4th Interger then press enter:" << endl;
cin >> D;
cout << "Enter 5th Interger then press enter:" << endl;
cin >> E;
if (A < E)
cout << "Ascending Order" << endl;
else if (A > E)
cout << "Descending Order" << endl;
else
{
cout << "Not in any order at all" << endl;
}
return 0;
}