Write a do-while loop that continues to prompt a user to enter a number less than 100
Answers
Answered by
0
'#'include <iostream> using namespace std;
int main() { int userInput = 0; cin>>userInput;
do {
cout<<"Enter a number (<100): "; } while (userInput < 100 ) ;
cout << endl;
cout << "Your number < 100 is: " << userInput << endl;
return 0;
}
int main() { int userInput = 0; cin>>userInput;
do {
cout<<"Enter a number (<100): "; } while (userInput < 100 ) ;
cout << endl;
cout << "Your number < 100 is: " << userInput << endl;
return 0;
}
Similar questions
Math,
9 months ago
Accountancy,
9 months ago
English,
9 months ago
English,
1 year ago
Social Sciences,
1 year ago
Hindi,
1 year ago