In the program below, 1 and 1000 are not included as a valid number. Why is it that when I enter 1 or 1000, the program does not say "enter a valid number"? It just ends the program. Help is appreciated. thanks
Code:
#include<iostream>
using namespace std;
int main()
{
int iX;
do {
cout << "Enter a Number between 1 and 1000." << endl;
cin >> iX;
if ( iX < 1 || iX > 1000) {
cout << "Enter Valid number. Try Again." << endl;
}
}while (1 > iX || iX > 1000);
return 0;
}
Comment