Well, after you read your variable via std::cin, then you have to check their values.
E.g. the following code keeps reading as long as the user doesn't enter a number between 1 and 100
#include <iostream>
int main()
{
int number;
do
{ std::cout << "Please, enter a number between 1 and 100 (inclusive): ";
std::cin >> number;
} while (number < 1 || number > 100);
std::cout << "You entered: " << number << std::endl;
return 0;
}
Does this help?