Skip to main content

MCQ Game in C++

 


#include<bits/stdc++.h>

using namespace std;

int main()
{
int i=1;
char a;
int correct = 0;
int incorrect = 0;
    cout<<"******** Here you can check you knowledge *********"<<endl;
    cout<<"******** Let's start the Game! *********"<<endl;
    // game();
       while(i<=2){
    switch (i)
    {
    case 1:
       cout<<"1. Which one of the following river flows between Vindhyan and Satpura ranges\n";
       cout<<"(a) Narmada\n(b) Mahanadi \n(c) Son\n(d) Netravati\n";
       cout<<"Enter your option: ";
      cin>>a;
      if(a =='A' || a =='a'){
correct=correct+1;
}
else{
incorrect=incorrect+1;
}
i++;
       
        case 2:
       cout<<"2. The Central Rice Research Station is situated in?\n";
       cout<<"(a) Chennai\n(b) Cuttack\n(c) Bangalore\n(d) Quilon\n";
       cout<<"Enter your option: ";
             cin>>a;
      if(a=='B' || a=='b'){
correct=correct+1;
}
else{
incorrect=incorrect+1;
}
i++;
 
    }
}

    cout<<"Your correct score is: "<<correct;
   
   
    return 0;
}

Comments