Hi Everyone, I've been coding out a type of case statement that would repeat itself. For example, the program will display a certain menu with a series of options. Once the user enters a number, a word is displayed... and i want the menu to come up again.
so far this is what i have...
int num;
cout << "Enter a choice between 1 and 3....... ";
cout << " 1. dog, 2. cat, 3. bird";
cin >> num;
cout << endl;
cout << "You have entered: " << num
<< endl;
switch(num)
{
case 0:
case 1:
cout << "dog ";
system ("pause");
break;
case 2:
cout << "cat ";
system ("pause");
break;
case 3:
cout << "bird " << endl;
system ("pause");
break;
}
return 0;
}
Now what I want to do is to repeat that, meaning after a number is entered, it will go back to the menu. What type of loop or command should I enter here?