Need help looping this switch statement
Hey guys I'm wondering how to loop the default at the end of the switch. I'm doing this so it will obviously have me go back and answer with 1, 2 or 3 again thanks.
Code:
#include <iostream>
using namespace std;
int main()
{
int myAnswer, i;
cout << "In what country is Wagga Wagga?" << endl;
cout << "1: Japan" << endl;
cout << "2: Australia" << endl;
cout << "3: Israel" << endl;
cin >> myAnswer;
switch (myAnswer)
{
case 1:
cout << "Incorrect" << endl;
break;
case 2:
cout << "Correct" <<endl;
break;
case 3:
cout << "Incorrect" << endl;
break;
default:
cout << "Please enter 1 2 or 3 for your answer" << endl;
}
system ("pause");
return 0;
}
please excuse how messy it looks but im in a hurry thanks