I'm trying to make program in which user is asked to enter 3 numbers. Each number must be between 1 and 1000. I have problems with while loop because I can't figure out the proper statement in which the loop won't run infinitely. If the number is less than 1 but bigger than 1000, the user will be asked to enter a number again.
# include <iostream>
using namespace std;
int a, b,c, sum;
int main (){
cout << "Enter first number:";
cin >> a;
while ( a <=1 || a<=1000)
cout<< "Entered number must between 1 .. 1000";
cout << "Enter second number:";
cin >> b;
if ( b <=1 || b <=1000)
cout<< "Entered number must between 1 .. 1000";
cout << "Enter third number:";
cin >> c;
if ( c <=1 || c <=1000)
cout<< "Entered number must between 1 .. 1000";
sum = a+b+c;
cout << a <<"+"<<b << "+"<< c << "Your sum is: " << sum << endl;
return 0;
}