Answer to Question #298339 in C++ for Chubby

Question #298339

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?


1
Expert's answer
2022-02-16T10:21:49-0500
#include <iostream>




using namespace std;


int main()
{
	int number=0;


	while(number<=10){
		cout<<"Enter a number: ";
		cin>>number;
	}
	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog