While Loop

I need help to write and application that displays a menu, with 2 choices, 1, 2 . if a person chooses 1. I need to print out a silly joke and then ask them to choose again, 1, 2.
2. If they pick 2 it says "how boring is that" and exit.
any other response should yield an error message.

What I have so far is the menu, could there be a way to write this without using if statements?

int main()
{
char myAnswer;
cout << "=============" << endl;
cout << "-------------" << endl;
cout << " MAIN MENU " << endl;
cout << "Choice 1 or 2?" << endl;
cout << "-------------" << endl;
cout << "=============" << endl;
cin >> myAnswer;

return 0;
}
Thank you in Advance
could there be a way to write this without using if statements?

Yes. Use a switch statement.
http://www.cplusplus.com/doc/tutorial/control/

Topic archived. No new replies allowed.