Need guidance with a loop

OK, just to let everyone know, I am sort of new to programming. I am making a quiz program, and I need a loop (I dont know which kind). I am trying to make it so that if I get a wrong answer it will repeat the question. I will post an example of the code below.

int question;
cout <<"\nWhat is the word that means to break away?: \n";
cout <<"1 - Unite\n";
cout <<"2 - Secede\n";

cout <<"Pick your question: ";
cin >>question;

switch (question)
{
case 1:
cout <<"WRONG!!.\n";
break;
case 2:
cout <<"CORRECT!!.\n";
break;
default:
cout <<"Error - Invalid input; only 1 or 2 allowed.\n";
}


If anyone could help it would be greatly appreciated. THANKS.
int question;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
do
{
   cout <<"\nWhat is the word that means to break away?: \n";
   cout <<"1 - Unite\n";
   cout <<"2 - Secede\n";
 
   cout <<"Pick your question: ";
   cin >>question;
 
   switch (question)
   {
      case 1:
         cout <<"WRONG!!.\n";
         break;
     case 2:
        cout <<"CORRECT!!.\n";
        break;
    default:
       cout <<"Error - Invalid input; only 1 or 2 allowed.\n";
   }
} while ( question != 1 && question != 2 );
Topic archived. No new replies allowed.