Thursday, April 5, 2007

hi girls,

Hope the preparations for the exam are going on well. All the best for ur exams. Here is a simple gk quiz program. This program can be made much more effective and efficient by modifying it. Hope this helps you to discover something new

#include
using namespace std;
#include
void main()
{
int x,y,z;
x=y=z=0;
char ch1[100],ch2,ch3,ch4,ch5,ch6,ch7,ch8,ch9,ch10,ch11;
cout<<"\n\t\tGK QUIZ";
cout<<"\n\t\t*******";
cout<<" \n\n\tGuest Enter Your Name: ";
cin>>ch1;
cout<<" \nWelcome "<cout<<"\n\n1.Enter answer in form of 'a','b' and'c'only.";
cout<<"\n\n\nWhat is called as ' THE HOLYLAND'?";
cout<<"\n\ta.Jerusalem\n\tb.Mathura\n\tc.Mecca";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n\n";
}
cout<<"\n2.What is called as ' THE ROOF OF THE WORLD'?";
cout<<"\n\ta.Nepal\n\tb.Rome\n\tc.Tibet";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
cout<<"Good Job.Your score is "<}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n3.What is called as ' THE LAND OF RISING SUN'?";
cout<<"\n\ta.Chicago\n\tb.Japan\n\tc.Tibet";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n4.What is called as ' THE GIFT OF NILE'?";
cout<<"\n\ta.Chicago\n\tb.Egypt\n\tc.Africa";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n5.What is called as ' THE LAND OF MIDNIGHT SUN'?";
cout<<"\n\ta.Norway\n\tb.Japan\n\tc.Australia";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n6.What is called as ' THE LAND OF THUNDERBOLT'?";
cout<<"\n\ta.Bhutan\n\tb.Canada\n\tc.Arab";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n7.What is called as ' THE WINDY CITY?";
cout<<"\n\ta.Jerusalem\n\tb.Japan\n\tc.Chicago";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n8.What is called as ' THE LAND OF WHITE ELEPHANTS'?";
cout<<"\n\ta.Bangladesh\n\tb.Thailand\n\tc.India";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='b')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n9.What is called as ' THE CITY OF SEVEN HILLS'?";
cout<<"\n\ta.Rome\n\tb.Nilgiri Hills\n\tc.Tibet";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='a')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\n10.What is called as ' THE DARK CONTIENENT'?";
cout<<"\n\ta.Asia\n\tb.Australia\n\tc.Africa";
cout<<"\n\nUr answer: ";
cin>>ch2;
if(ch2=='c')
{
x=x+10;
}
else
{
cout<<"Sorry wrong answer.\n";
}
cout<<"\n\nRESULT: ";
if(x==100)
{
cout<<"\n\nNo cheating...... You have done this earlier also.";
}
else if(x==90)
{
cout<<"\n\nYou are extremely intelligentYour Score is 90";
}
else if(x==80)
{
cout<<"\n\nYou are intelligent Your Score is 80";
}
else if(50==xx==70x==60)
{
cout<<"\n\nYou are average Your Score is "<}
else if(x<=40)
cout<<"\n\nNo use........ Not even 5 questions right";
getch();
}

No comments: