C++ Quiz Code Project

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

#include<iostream.

h>
#include<conio.h>
void main()
{
clrscr();
int x,y,z;
x=y=z=0;
char ch1[100],ch2,ch3,ch4,ch5,ch6,ch7,ch8,ch9,ch10,ch11;
cout<<" Enter Your Name";
cin>>ch1;
clrscr();
cout<<" Welcome "<<ch1<<"QUIZ TIME";
cout<<"Enter answer in form of �a','b' and'c'only.";
cout<<"What is the capital of Russia? \na.Moscow\nb.Sydney\nc.Mecca";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
cout<<"Good Job.Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Which is the hobby recognized by the United
Nations?\na.Writng\nb.Dancing\nc.Ham Radio";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
cout<<"Good Job.Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Which is the highest mountain in
Europe?\na.Mt.Kilimanjaro\nb.Mt.Elbruz\nc.Mt.Everest";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
cout<<"Good Job.Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Which is the oldest sport in the
world?\na.Wrestling\nb.Archery\nc.Basketball";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"What is the normal duration of Hockey game?\na.70mins\nb.45,ins\nc.90mins";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"When did partiton of Bengal happened?\na.1905\nb.1858\nc.1809";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Phobos is the moon of which planet?\na.Jupiter\nb.Mars\nc.Neptune";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Who is the writer of Inida's National Anthem?\na.Rehman
Shafiq\nb.Rabindranath Tagore\nc.Heba Noor";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"Who is the current chief minister of gujarat?\na.Vijay Rupani\nb.Mamata
Banjerjee\nc.Arvind Kejrival";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
cout<<"Your score is "<<x;}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
cout<<"How many members aare there in United Nations?\na.180\nb.155\nc.193";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
cout<<"Your score is "<<x;
}
else
cout<<"Sorry wrong answer.";
getch();
clrscr();
if(x==100)
cout<<"You're doing it again.Sure";
if(x==90)
cout<<"wow its awesome";
if(x==80)
cout<<"You are intelligent.";
if(50==x||x==70||x==60)
cout<<"You are average.Your Score is "<<x<<"Try Next time";
else if(x<=40)
cout<<"Try hard.Don't lose hope";
getch();
}

You might also like