creating a menu

I'm trying to create a menu that will allow the user to enter 0-quit, 1-Continue and the program should only quit if the user enters 0 for quit or continue if the user enters 1 for continue - I know it's simple but cant think of the right syntax or procedure for this part of my program

How would i do this???
There are a lot of different ways to do this. One very simple way is to do the following.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

using namespace std;

int main ()
{
int selection;
cout << Please select from the following options.\n
<<"1. Continue\n"
<<"2. Quit\n"
<<"Selection: ";
cin >> selection;
if (selection==2)
{
cout <<"Goodbye\n";
return 0;
}

}
Topic archived. No new replies allowed.