Write a program to enter a number that should be less than 100 and greater than 9.
#include <iostream>
using namespace std;
int main()
{
int num;
do
{
cout << "Please, enter a number than less 100 and greater than 9: ";
cin >> num;
if (num < 100 && num>9)
{
cout << "Good entering!";
break;
}
else
{
cout << "Bad entering! Retry please!" << endl;
}
} while (true);
}
Comments
Leave a comment