I'm having a problem trying to write a loop that tells the user to input a positive number. And if number is zero the program stops. The numbers can be no greater than 1000.
Code:
# include <iostream> using namespace std; int main() { int i; int num; while (num >0) { cout<< "Enter a positive number:"<<endl; cin>> num; if (num=0) cout<<"END OF PROGRAM"; else { cout<< num; } } return 0; }
Comment