How to create c++ program using while loop that will get a number from the user. If the user inputs a number of more than 10, the program will be terminated, hence if lower than 10, the program will keep asking the user input number?
#include <iostream>
using namespace std;
int main()
{
int number=0;
while(number<=10){
cout<<"Enter a number: ";
cin>>number;
}
system("pause");
return 0;
}
Comments
Leave a comment