Advertisement
Guest User

Mini Quiz By Aryan Verma

a guest
May 4th, 2015
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.66 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     cout<<"Hello! Lets Check your General Knowledge";
  5.     cout<<"\nHere's Your Score: 0";
  6.     cout<<"\nSo, Lets Start\n";
  7.     int a,month,Score=0;
  8.     cout<<"\nWho is the Prime Mininster of India?\n";
  9.     cout<<"\n1. Narendra Singh Modi 2. Pranav Muhkarhyee\n\n";
  10.     cout<<"Choose the Correct Option(1/2):\n";
  11.     cin>>a;
  12.     if(a==1){cout<<"\nCongratz thats the right answer";
  13.     cout<<"\nYou got one point...+1\n\n";
  14.     cout<<"Score: 1";
  15.     }
  16.     else{cout<<"Wrong Answer..\a";
  17. }
  18. cout<<"\nYour second question is..\n";
  19. cout<<"\nWhat is Month May's postion in numbers(1-12)?";
  20. cout<<"\n\nEnter the correct number:";
  21. cin>>month;
  22.  
  23. switch(month){
  24. case 1:
  25.      cout<<"Wrong Answer 1st Month is January\n";
  26.      break;
  27. case 2:
  28.      cout<<"Wrong Answer 2nd Month is February\n";
  29.      break;
  30. case 3:
  31.      cout<<"Wrong Answer 3rd Month is March\n";
  32.      break;
  33. case 4:
  34.      cout<<"Wrong Answer 4th Month is April\n";
  35.      break;
  36. case 5:
  37.      cout<<"Right Answer! 5th Month is May\n";
  38.      if(a==1)cout<<"\nYour Score is: 2";
  39.      else{cout<<"\nYour Score is: 1";
  40.      }
  41.      break;
  42. case 6:
  43.      cout<<"Wrong Answer 6th Month is June\n";
  44.      break;
  45. case 7:
  46.      cout<<"Wrong Answer 7th Month is July\n";
  47.      break;
  48. case 8:
  49.      cout<<"Wrong Answer 8th Month is August\n";
  50.      break;
  51. case 9:
  52.      cout<<"Wrong Answer 9th Month is September\n";
  53.      break;
  54. case 10:
  55.      cout<<"Wrong Answer 10th Month is October\n";
  56.      break;
  57. case 11:
  58.      cout<<"Wrong Answer 11th Month is November\n";
  59.      break;
  60. case 12:
  61.      cout<<"Wrong Answer 12th Month is December\n";
  62.      break;
  63.      
  64. default:
  65.   cout<<"\n\nPlease Enter a Number between 1 to 12..";
  66.   break;
  67. }
  68.                    
  69. cout<<endl;
  70. system("pause");
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement