I want to loop the same statement "Please enter a number other than 5" over and over again unless they enter the number 5, that's when I want to break out of it.
Is this the best way to do it?
1 2 3 4 5 6 7 8 9 10
//ask user to enter a number except for 5, if number is not 5 keep asking
cout << "Please enter a number other than 5." << endl;
cin >> x;
do
{
cout << "Please enter a number other than 5." << endl;
cin >> x;
} while (x > 5 && x < 5);