mixing loops and if else statements
is this possible
1 2 3 4 5 6 7 8 9 10 11 12
|
do
{
cout << "How many people are playing?" << endl;
cin >> choice;
if (choice > 1 && choice < 2)
{
cout << "That is not a valid answer!" << endl;
}
} while (choice > 1 && choice < 2)
else if
{}
else{}
|
Last edited on
No. The else if and else part can't be outside the loop if the "if" part is inside.
Topic archived. No new replies allowed.