ana
2018-06-19 17:12:04 UTC
The program does not have errors and it runs, however, when I pick a menu option and hit enter it goes directly back to my code and closes the menu window.
I tried system ("pause") . Is there anything else I should be doing? thank you!
#include
using namespace std;
int main()
{
cout << "Difficulty Levels\n\n";
cout << "1 - Easy\n";
cout << "2 - Normal\n";
cout << "3 - Hard\n\n";
int choice;
cout << "Choice: ";
cin >> choice;
switch (choice)
{
case 1:
cout << "You picked Easy.\n";
break;
case 2:
cout << "You picked Normal.\n";
break;
case 3:
cout << "You picked Hard.\n";
break;
default:
cout << "You made an illegal choice.\n";
}
return 0;
}