Skip to main content

WELCOME TO THE GREAT BHAVAN'S QUIZ COMPETITION !!!

Program Created By :- Arindam Bera 



-------------------------------------------------------------------------------------------------------------
#include<iostream.h>
#include<string.h>                                                                                        //header files
#include<stdio.h>
void main ()
{
int aa=0,ab=0,ac=0,ad=0,ba=0,bb=0,bc=0,bd=0,ax,bx,ca=0,wa=0,pa=0,cb=0,wb=0,pb=0;                          //variables declared
char x[100],a[100],b[100],y;
abc:
cout<<"******************************************************************************"<<endl;
cout<<"             WELCOME TO THE GREAT BHAVAN'S QUIZ COMPETITION !!!               "<<endl;             //welcome note displayed
cout<<"******************************************************************************"<<endl;
cout<<endl;
cout<<endl;
cout<<" Enter the name of the first participant : ";                                                      //name of the the players taken as input
cin>>a;
cout<<" Enter the name of the second participant: ";
cin>>b;
cout<<endl;
cout<<endl;
cout<<"SO "<<a<<" AND "<<b<<"  HERE ARE SOME OF THE RULES AND REGULATIONS OF THE QUIZ"<<endl;             //rules and regulations displayed
cout<<"(1)The quiz comprises of 4 rounds each having 5 questions."<<endl;
cout<<"(2)Each group has different topics."<<endl;
cout<<"(3)For each correct answer you will get 10 points."<<endl;
cout<<"(4)For each wrong answer 2 marks will be deducted."<<endl;
cout<<endl;
cout<<"**Write only the correct option number.Press P for passing.**"<<endl;
cout<<"Are you ready for the quiz? Y/N"<<endl;
cin>>y;                     
if((int)y==89||(int)y==121)
{
cout<<endl;
cout<<endl;
cout<<"-------------    R  O  U  N  D    1    B  E  G  I  N  S  --------------"<<endl;                     //beginning of round1
cout<<endl;
cout<<endl;
cout<<"  THIS ROUND IS BASED ON SCIENCE AND TECHNOLOGY  "<<endl;
cout<<endl;
cout<<" Soo "<<a<< " it's your turn !! Get set goo !!"<<endl;
cout<<" Here's the first question of first round:- "<<endl;
cout<<" Who invented steam engine ?"<<endl;                                                               // first question displayed
cout<<" (a)Steve cook                  (b)James Watt"<<endl;                                        //options displayed
cout<<" (c)Rutherford                            (d)ALbert Einstein"<<endl;
gets(x);                                                                                                  //correct option taken as input
if (strcmp(x,"b")==0||strcmp(x,"B")==0)                                                                   //condition given
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
aa=aa+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
aa=aa+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B "<<endl;
aa=aa-2;
wa++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of first round:-"<<endl;
cout<<" Who invented theory of relativity ??"<<endl;
cout<<" (a)Steve Jobs                           (b)Isaac Newton"<<endl;
cout<<" (c)J C Bose                               (d)Albert Einstein"<<endl;
gets(x);
if (strcmp(x,"d")==0||strcmp(x,"D")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
aa=aa+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
aa=aa+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is D "<<endl;
aa=aa-2;
wa++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of first round:- "<<endl;
cout<<" Who invented computer first ?"<<endl;
cout<<" (a)Charles Babbage           (b)Louis D Souza"<<endl;
cout<<" (c)Robert Rajnikant                       (d)Peter Middleton"<<endl;
gets(x);
if (strcmp(x,"A")==0||strcmp(x,"a")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
aa=aa+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
aa=aa+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is A "<<endl;
aa=aa-2;
wa++;
}
cout<<endl;
cout<<"     "<<a<<"  your turn is over in this round !! be ready for the next round      !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Now "<<b<< " it's your turn !! Get set goo !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Here's the first question of first round:- "<<endl;
cout<<" In which organ in human body blood is filtered?"<<endl;
cout<<" (a)Lungs                   (b)Brain"<<endl;
cout<<" (c)Heart                                  (d)Kidney"<<endl;
gets(x);
if (strcmp(x,"d")==0||strcmp(x,"D")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ba=ba+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ba=ba+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is D"<<endl;
ba=ba-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of first round:-"<<endl;
cout<<" What is the full form of 'GSM' in GSM Cellphones ??"<<endl;
cout<<" (a)Globally Similar Mobiles           (b)Global Safe Mobilephones"<<endl;
cout<<" (c)Global System for Mobile Communications        (d)Good Service Mobiles"<<endl;
gets(x);
if (strcmp(x,"C")==0||strcmp(x,"c")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ba=ba+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ba=ba+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is C "<<endl;
ba=ba-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of first round:- "<<endl;
cout<<" Who invented Touch-Screen technology ??"<<endl;
cout<<" (a)E.A Johnson                           (b)Ron Wackher"<<endl;
cout<<" (c)Steve Jobs                             (d)S Kumar"<<endl;
gets(x);
if (strcmp(x,"A")==0||strcmp(x,"a")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ba=ba+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ba=ba+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
wb++;
cout<<"Sorry!!!!wrong answer!! The correct option is A"<<endl;
ba=ba-2;
}
cout<<endl;
cout<<endl;
cout<<"---------------- E  N  D         O  F      R  O  U  N  D   1 ------------------"<<endl;               //end of round 2
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"----------------      R  O  U  N  D    2    B  E  G  I  N  S  -----------------"<<endl;              //beginning of round2
cout<<endl;
cout<<endl;
cout<<"      THIS ROUND IS BASED ON GENERAL KNOWLEDGE  "<<endl;
cout<<endl;
cout<<" Soo "<<a<< " it's your turn !! Get set goo !!"<<endl;
cout<<" Here's the first question of second round:- "<<endl;
cout<<" Which is the largest desert in the world? "<<endl;
cout<<" (a)Sahara Desert                          (b)Kalahari Desert"<<endl;
cout<<" (c)Thar desert                            (d)Taklamakan Desert"<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)                                                                      //condition given
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ab=ab+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ab=ab+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
wa++;
cout<<"Sorry!!!!wrong answer!! The correct option is A"<<endl;
ab=ab-2;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of second round:- "<<endl;
cout<<" Yen is the currency of which country? "<<endl;
cout<<" (a) China                   (b)Nepal"<<endl;
cout<<" (c)Indonesia                              (d)Japn"<<endl;
gets(x);
if (strcmp(x,"d")==0||strcmp(x,"D")==0)                                                                     //condition given
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ab=ab+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ab=ab+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
wa++;
cout<<"Sorry!!!!wrong answer!! The correct option is D"<<endl;
ab=ab-2;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of second round:- "<<endl;
cout<<" Who led the Indian National Army? "<<endl;
cout<<" (a)Jawaharlal Nehru           (b)Subhash Chandra Bose"<<endl;
cout<<" (c)Kodandera Cariappa                     (d)George Allenby"<<endl;
gets(x);
if ( strcmp(x,"b")==0||strcmp(x,"B")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ab=ab+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
pa++;
ab=ab+0;
cout<<"The correct option is B !!"<<endl;
}
else
{
wa++;
cout<<"Sorry!!!!wrong answer!! The correct option is B "<<endl;
ab=ab-2;
}
cout<<endl;
cout<<"        "<<a<<"    your turn is over in this round !! be ready for the next round      !!"<<endl;
cout<<endl;
cout<<endl;
cout<<"   Now   "<<b<< "    it's your turn !! Get set goo  !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Here's the first question of second round:-"<<endl;
cout<<" Who inroduced the Rupee symbol?"<<endl;
cout<<" (a)L K Rana                           (b)K A Acharya"<<endl;
cout<<" (c)S K Narayan                            (d)D Udaya Kumar "<<endl;
gets(x);
if (strcmp(x,"d")==0||strcmp(x,"D")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bb=bb+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bb=bb+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is D"<<endl;
bb=bb-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of second round:-"<<endl;
cout<<" Which cartoon is best known with spinach? "<<endl;
cout<<" (a)Popeye                   (b)Noddy"<<endl;
cout<<" (c)Mickey Mouse                           (d)Tom & Jerry"<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bb=bb+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bb=bb+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is A"<<endl;
bb=bb-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of second round:-"<<endl;
cout<<" After whom was Mount Everest named ?"<<endl;
cout<<" (a)Sir William Everest           (b)Sir George Everest"<<endl;
cout<<" (c)Sir Frank Everest                      (d)Sir Kiadu Everest"<<endl;
gets(x);
if ( strcmp(x,"b")==0||strcmp(x,"B")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bb=bb+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bb=bb+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B "<<endl;
bb=bb-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<"------------- E  N  D         O  F      R  O  U  N  D   2 ---------------"<<endl;                     //end of round 2
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"-----------      R  O  U  N  D    3    B  E  G  I  N  S  ---------------"<<endl;                      //beginning of round3
cout<<endl;
cout<<endl;
cout<<"  THIS ROUND IS BASED ON SPORTS  "<<endl;
cout<<endl;
cout<<" Soo "<<a<< " it's your turn !! Get set goo !!"<<endl;
cout<<" Here's the first question of third round:- "<<endl;
cout<<" Who has the highest number of centuries in international cricket ?"<<endl;
cout<<" (a)Sachin Tendulkar                   (b)Brian Lara"<<endl;
cout<<" (c)Ricky Ponting                          (d)Kapil Dev"<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ac=ac+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ac=ac+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is A "<<endl;
ac=ac-2;
wa++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of third round:-"<<endl;
cout<<" Who won ICC Award for Test player of the year 2011?"<<endl;
cout<<" (a)Mahela Jayawardene                   (b)Graeme Smith"<<endl;
cout<<" (c)Rahul Dravid                           (d)Alastair Cook"<<endl;
gets(x);
if (strcmp(x,"D")==0||strcmp(x,"d")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ac=ac+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ac=ac+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is D"<<endl;
ac=ac-2;
wa++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of third round:-"<<endl;
cout<<" Who won cricket world cup 2011 ?"<<endl;
cout<<" (a)Pakistan                           (b)India"<<endl;
cout<<" (c)Australia                              (d)England"<<endl;
gets(x);
if (strcmp(x,"b")==0||strcmp(x,"B")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ac=ac+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ac=ac+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B"<<endl;
ac=ac-2;
wa++;
}
cout<<endl;
cout<<"     "<<a<<"  your turn is over in this round !! be ready for the next round      !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Now "<<b<< " it's your turn !! Get set goo !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Here's the first question of third round:-"<<endl;
cout<<" Where will the 2014 Football World Cup be held ?"<<endl;
cout<<" (a)India                                  (b)Germany"<<endl;
cout<<" (c)Brazil                                 (d)Argentina"<<endl;
gets(x);
if (strcmp(x,"C")==0||strcmp(x,"c")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bc=bc+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bc=bc+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is C"<<endl;
bc=bc-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of third round:-"<<endl;
cout<<" Who won US Open 2011?"<<endl;
cout<<" (a)Novak Djokovic                         (b)Sania Mirza"<<endl;
cout<<" (c)Roger Federer                          (d)Rafael Nadal"<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bc=bc+10;cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bc=bc+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is  A"<<endl;
bc=bc-2;
wb++;
}
cout<<endl;
cout<<endl;;
cout<<" Here's the third question of third round:- "<<endl;
cout<<" Which cricketer has an average of 99.96 ?"<<endl;
cout<<" (a)Brett Lee                              (b)Sir Donald Bradman"<<endl;
cout<<" (c)Parthiv Patel                          (d)Sachin Tendulkar"<<endl;
gets(x);
if (strcmp(x,"b")==0||strcmp(x,"B")==0 )
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bc=bc+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bc=bc+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B"<<endl;
bc=bc-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<"------------------- E  N  D         O  F      R  O  U  N  D   3 -------------------"<<endl;           //end of round 3
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"-------------------  R  O  U  N  D    4    B  E  G  I  N  S  ------------------"<<endl;                //beginning of round4
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"-------------------T H I S   IS  T H E   F I N A L  R O U N D ---------------"<<endl;
cout<<endl;
cout<<endl;
cout<<"  THIS ROUND IS BASED ON FILMS AND ENTERTAINMENT  "<<endl;
cout<<endl;
cout<<" Soo "<<a<< " it's your turn !! Get set goo !!"<<endl;
cout<<" Here's the first question of fourth round:- "<<endl;
cout<<" Who directed the fim Rockstar ?"<<endl;
cout<<" (a)Amir Khan                            (b)Ram Gopal Verma"<<endl;
cout<<" (c)Imitiaz Ali                             (d)A R Rahaman "<<endl;
gets(x);
if (strcmp(x,"c")==0||strcmp(x,"C")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ad=ad+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ad=ad+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is C"<<endl;
ad=ad-2;
wa++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of fourth round:- "<<endl;
cout<<" Who was the first indian to get Oscar ?"<<endl;
cout<<" (a)Bhanu Athaiya                    (b)Rajnikant"<<endl;
cout<<" (c)Aishwarya Rai                           (d)Dev Anand "<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ad=ad+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ad=ad+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
wa++;
cout<<"Sorry!!!!wrong answer!! The correct option is A"<<endl;
ad=ad-2;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of fourth round:-  "<<endl;
cout<<" How many Oscars did Slumdog Millionaire get ?"<<endl;
cout<<" (a)6                                    (b)8"<<endl;
cout<<" (c)7                                       (d)9 "<<endl;
gets(x);
if (strcmp(x,"b")==0||strcmp(x,"B")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
ad=ad+10;
ca++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
ad=ad+0;
pa++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B"<<endl;
ad=ad-2;
wa++;
}
cout<<endl;
cout<<"     "<<a<<"  your turn is over in this round !! Be ready for the scoress     !!"<<endl;
cout<<endl;
cout<<endl;

cout<<" Now "<<b<< " it's your turn !! Get set goo !!"<<endl;
cout<<endl;
cout<<endl;
cout<<" Here's the first question of fourth round:- "<<endl;
cout<<" What is India's first Stereoscopic 3D movie ?"<<endl;
cout<<" (a)Haunted                            (b)Blue"<<endl;
cout<<" (c)Ra One                                  (d)3 idiots "<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bd=bd+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bd=bd+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is A"<<endl;
bd=bd-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the second question of fourth round:- "<<endl;
cout<<" What is the original name of A R Rahman ?"<<endl;
cout<<" (a)Shayeed Quadri                          (b)A S Dileep Kumar"<<endl;
cout<<" (c)A R Chauhan                             (d)A K Johnes "<<endl;
gets(x);
if (strcmp(x,"b")==0||strcmp(x,"B")==0)
{
cout<<"Absolutely corret answer....congrats!!! "<<endl;
bd=bd+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bd=bd+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is B"<<endl;
bd=bd-2;
wb++;
}
cout<<endl;
cout<<endl;
cout<<" Here's the third question of fourth round:- "<<endl;
cout<<" What was Amitabh Bachchan's first movie ?"<<endl;
cout<<" (a)Saat Hindustani                         (b)Don "<<endl;
cout<<" (c)Paa                                     (d)Mera Pyaar "<<endl;
gets(x);
if (strcmp(x,"a")==0||strcmp(x,"A")==0)
{
cout<<"Absolutely correct answer....congrats!!! "<<endl;
bd=bd+10;
cb++;
}
else if (strcmp(x,"p")==0 || strcmp(x,"P")==0)
{
bd=bd+0;
pb++;
cout<<"The correct option is B !!"<<endl;
}
else
{
cout<<"Sorry!!!!wrong answer!! The correct option is A "<<endl;
bd=bd-2;
wb++;
}
cout<<endl;
cout<<"   THATS THE END OF THE QUIZ !! LET'S FIND OUT THE SCORES !!   "<<endl;
cout<<endl;
ax=aa+ab+ac+ad;                                                                                               //total marks of player1 calculated
bx=ba+bb+bc+bd;                                                                                               //total marks of player2 calculated
cout<<endl;
cout<<"*+*+*+*+*+*+*+*+*+*+*+*+*  S  C  O  R  E  C  A  R  D  *+*+*+*+*+*+*+*+*+*+*+*+*"<<endl;                //scorecard displayed
cout<<endl;
cout<<endl;
cout<<"NAME\t ROUND 1\t ROUND 2\t ROUND 3\t ROUND 4\t SCORE"<<endl;
cout<<a<<"\t "<<aa<<"\t\t "<<ab<<"\t\t "<<ac<<"\t\t "<<ad<<"\t\t "<<ax<<endl;
cout<<b<<"\t "<<ba<<"\t\t "<<bb<<"\t\t "<<bc<<"\t\t "<<bd<<"\t\t "<<bx<<endl;
cout<<endl;
cout<<"________________________________________________________________________________"<<endl;
cout<<"         ~~~ "<<a<<" ~~~       "<<"\t\t"<<"         ~~~ "<<b<<" ~~~       "<<endl;
cout<<"Number of correct answers : "<<ca<<"\t\t"<<"Number of correct answers :"<<cb<<endl;
cout<<"Number of wrong answers   : "<<wa<<"\t\t"<<"Number of wrong answers   :"<<wb<<endl;
cout<<"Number of pass            : "<<pa<<"\t\t"<<"Number of pass            :"<<pb<<endl;
cout<<endl;
cout<<endl;
if (ax>bx)                                                                                                    //condition of winning given
{
cout<<"------------  THE WINNER IS "<<a<<" !!!! CONGRATULATONS !! ---------"<<endl;                           //winner declared if condition satisfies
cout<<"        ´´´´´´´´´´¶¶*..**..*                    "<<endl;
cout<<"        ´´´´´´´´´¶¶¶ .*.*.*.                     " <<endl;
cout<<"        ´´´´´´´¶¶´¶*..**.*.                      "<<endl;
cout<<"        ´¶¶¶¶¶¶¶¶´´¶*.*.**..**.                  "<<endl;
cout<<"       ´´´¶¶´´´´´´¶¶¶¶¶¶¶¶¶*.*.*.*.*.            "<<endl;
cout<<"       ´´´´´¶¶´¶¶´´´´¶¶¶¶*.*.**.                 "<<endl;
cout<<"        ´´´´¶¶´´´´´¶¶¶.**.**.*.                  "<<endl;
cout<<"         ´´´¶¶´¶¶¶¶´´¶*.*.*.**.                    "<<endl;
cout<<"       ´´¶¶¶¶¶´´¶¶´¶´´´´´´´´¶*.**.*.*.*          "<<endl;
cout<<"       ´¶¶´´´´´´´´¶¶¶´´´´´´¶¶*..**.*.            "<<endl;
cout<<"       ´´´´´´´´´´´´¶¶´´´´                        "<<endl;
}
else if (ax<bx)
{
cout<<"-----  THE WINNER IS "<<b<<" !!!! CONGRATULATONS !! -----"<<endl;
cout<<"      ´ ´´´´´´´´´¶¶*..**..*                    "<<endl;
cout<<"       ´´´´´´´´´¶¶¶ .*.*.*.                     " <<endl;
cout<<"       ´´´´´´´¶¶´¶*..**.*.                      "<<endl;
cout<<"        ´¶¶¶¶¶¶¶¶´´¶*.*.**..**.                  "<<endl;
cout<<"       ´´´¶¶´´´´´´¶¶¶¶¶¶¶¶¶*.*.*.*.*.            "<<endl;
cout<<"      ´´´´´¶¶´¶¶´´´´¶¶¶¶*.*.**.                 "<<endl;
cout<<"       ´´´´¶¶´´´´´¶¶¶.**.**.*.                  "<<endl;
cout<<"      ´´´¶¶´¶¶¶¶´´¶*.*.*.**.                    "<<endl;
cout<<"      ´´¶¶¶¶¶´´¶¶´¶´´´´´´´´¶*.**.*.*.*          "<<endl;
cout<<"      ´¶¶´´´´´´´´¶¶¶´´´´´´¶¶*..**.*.            "<<endl;
cout<<"      ´´´´´´´´´´´´¶¶´´´´                        "<<endl;
}
else if (ax==bx)
cout<<"----------------------------- THE GAME IS A TIE !! --------------------------"<<endl;                  //game declared tie if nobody wins
cout<<endl;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<"*****************************************************************************"<<endl;                  //thanks giving note
cout<<"***********************THANK YOU FOR PLAYING WITH US*************************"<<endl;
cout<<"*****************************************************************************"<<endl;
cout<<endl;
cout<<endl;
cout<<"               Want to play again? press 'y' for yes or 'n' for no                    "<<endl;
cin>>y;
if ((int)y==89||(int)y==121)
{                                                                                                             //opinion taken for replaying the game
goto abc;
}
else
{
cout<<"Hope to see you again";
}
}
else
cout<<"BYE!!!come back later.";                                                                               //goodbye note displayed
}

Popular posts from this blog

C++ Program to find the sum, difference, product and quotient of two integers

#include <iostream.h> #include <conio.h> void main() {   clrscr();   int x = 10;   int y = 2;   int sum, difference, product, quotient;   sum = x + y;   difference = x - y;   product = x * y;   quotient = x / y;   cout << "The sum of " << x << " & " << y << " is " << sum << "." << endl;   cout << "The difference of " << x << " & " << "y <<  is " << difference << "." << endl;   cout << "The product of " << x << " & " << y << " is " << product << "." << endl;   cout << "The quotient of " << x << " & " << y << " is " << quotient << "." << endl;   getch(); }

Program of virtual piano

//////////////Tested And Created By C++/////////////////////////////// #include<stdio.h> #include<dos.h> #include<conio.h> #include<stdlib.h> #define SHOW 1 #define HIDE 2 union REGS input,output; class piano {  public:int BIGKEY,MIDKEY,back,border;     piano()//init constructor     {         BIGKEY=15;         MIDKEY=1;         back=7;         border=15;     } }color; void drawpiano(int x,int y); int check_xy(int x,int y); void BOX(int c,int r,int c1,int r1,int col); int initmouse(); void setupscreen(); void pointer(int on); void restrictmouse(int x1,int y1,int x2,int y2); void check_keys(int x,int y); void getmouse(int *button,int *x,int *y); float freq[7] = {130.81, 146.83, 164.81, 174.61,196, 220, 246.94 } ; int n=0,a=4,backcolor=2,exitcode=1; void showbar(int t) {  if(t>65) t=65;  if(t<1) t=1;  textcolor(15);  for(int q=0;q<=t;t++)  {     gotoxy(3+q,4);     cprintf("Û");  } } void main() {  int

Putimage function in c

putimage function outputs a bit image onto the screen. Declaration:- void putimage(int left, int top, void *ptr, int op); putimage puts the bit image previously saved with getimage back onto the screen, with the upper left corner of the image placed at (left, top). ptr points to the area in memory where the source image is stored. The op argument specifies a operator that controls how the color for each destination pixel on screen is computed, based on pixel already on screen and the corresponding source pixel in memory. c smiling face animation This animation using c draws a smiling face which appears at random position on screen. See output below the code, it will help you in understanding the code easily. C programming code #include<graphics.h> #include<conio.h> #include<stdlib.h>   main() { int gd = DETECT, gm, area, temp1, temp2, left = 25, top = 75; void *p;   initgraph(&gd,&gm,"C:\\TC\\BGI");   setcolor(YELLOW);