Welcome to Kaun Banega Crorepati
# include <stdio.h>
# include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include"line2.h"
int i;char y;
void end()
{
printf("\n You Entered y \n");
printf("\n The program is ending !\n");
printf("\n Thank you for playing\n");
printf("\n Press any key to exit\n");
getch();
}
void play()
{
void q2();
void sound();
printf("\n Your first question is-\n");
printf("\n Which is the capital of Maharashtra?\n");
printf("\n 1) Delhi" "\t" " 2) Mumbai\n");
printf("\n 3) Ranchi" "\t" " 4) Goa \n");
scanf("%d",&i);
clrscr();
jeevan();
if(i==2)
{
printf("\n You win Rs 1000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
exit(0);
}
else
{
q2();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q2()
{
void q3();
printf("\n Your secound question for Rs 2000 is:-\n");
printf("\n The first Prime Minister of India was-\n");
printf("\n 1). P.L.Shastri" "\t"" 2). Indira Gandhi\n");
printf("\n 3). Motilal Nehru" "\t" " 4). J.N.Nehru\n");
scanf("%d",&i);
clrscr();
jeevan();
if(i==4)
{
printf("\n You win Rs 2000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n ");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
exit(0);
}
else
{
q3();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q3()
{
void q4();
printf("\n Your next question for Rs 5000 is:-\n");
printf("\n Who is the Father of Yuvraj Sigh?\n");
printf("\n 1). Yogray Singh" "\t" " 2).B.S.Bedi\n");
printf("\n 3). Lovely Singh" "\t" " 4). G.Vishwanath\n");
scanf("%d",&i);
clrscr();
jeevan();
if(i==1)
{
printf("\n Congratulations ! You win Rs 5000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
}
else
{
q4();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q4()
{
void q5();
printf("\n Your next question for Rs 10000 is-\n");
printf("\n The first women Prime Minister of India is-\n");
printf("\n 1). Sonia Gandhi " "\t" " 2).Indira Gandhi\n");
printf("\n 3). Shushma Swaray" "\t" " 4).Annie Besent \n");
scanf("%d",&i);
if(i==2)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 10000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
}
else
{
q5();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q5()
{
void q6();
printf("\n Your next question for Rs 20,000 is -\n");
printf("\n Which is the currency of Pakistan ?\n");
printf("\n 1). Rouble" "\t" " 2). Rupee\n");
printf("\n 3). Peso " "\t" " 4). Pakistani Rupee\n");
scanf("%d",&i);
if(i==2)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 20,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
}
else
{
q6();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q6()
{
void q7();
printf("\n Your next qustion for Rs 50,000 is-\n");
printf("\n The older name of Sri Lanka was?\n");
printf("\n 1). Lanka " "\t" " 2). Ceylon \n");
printf("\n 3). Babylon" "\t" " 4). Malawi\n");
scanf("%d",&i);
if(i==2)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 50,000\n");
printf("\n Pres Any key to continue \n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
}
else
{
q7();
}
}
else
{
printf("\n Try Again\n");
play();
}
}
void q7()
{
void q8();
printf("\n Your next question for Rs 1,20,000 is-\n");
printf("\n The Painter of the famous painting of ' MONALISA ' is?\n");
printf("\n 1). Columbus " "\t" " 2). Alexander \n");
printf("\n 3). Holmes " "\t" " 4). Leonardo da vinci\n");
scanf("%d",&i);
if(i==4)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 1,20,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q8();}
}
else
play();
}
void q8()
{
void q9();
printf("\n Your next question for Rs 2,40,000 is--\n");
printf("\n The H.Q. of UNICEF is located at?\n");
printf("\n 1).New York " "\t" " 2). Geneva \n");
printf("\n 3).Dubai " "\t" " 4). Berlin \n");
scanf("%d",&i);
if(i==2)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 2,40,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q9();}
}
else
{printf("\n Try Again\n");
play();
}}
void q9()
{void q10();
printf("\n Your next question for Rs 3,60,000 is--\n");
printf("\n The First Governar General of Free India was ?\n");
printf("\n 1). Joseph Simon " "\t" " 2). H.Rodrigues \n");
printf("\n 3). Warren Hastings" "\t" " 4). Lord Mountbatten\n");
scanf("%d",&i);
if(i==4)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 3,60,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q10();}}
else
{printf("\n Try Again\n");
play();
}
}
void q10()
{void q11();
printf("\n Your next question for Rs 7,20,000 is---\n");
printf("\n The Historic 'Troyan War' was fought between?\n");
printf("\n 1). Italy and Arab " "\t" " 2). Troy and Italy \n");
printf("\n 3). Troy and Greece " "\t" " 4). Greece and Italy\n");
scanf("%d",&i);
if(i==3)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 7,20,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q11();}}
else
{printf("\n Try Again\n");
play();
}
}
void q11()
{void q12();
printf("\n Your next question for Rs 12,50,000 is--\n");
printf("\n The historic day when man entered the space was\n ");
printf("\n 1). 12th April 1961 " "\t" " 2). 26th May 1964\n");
printf("\n 3). 9th August 1957 " "\t" " 4). 1st December 1958\n");
scanf("%d",&i);
if(i==1)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 12,50,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q12();}}
else
{printf("\n Try Again\n");
play();
}
}
void q12()
{void q13();
printf("\n Your next question for Rs 25,00,000 is --\n");
printf("\n The title of 'Mahatma' was given to Ghandi Ji by?\n");
printf("\n 1). Queen Elizabeth " "\t" " 2). Rabindranath Tagore \n");
printf("\n 3). Lord Mountbatten " "\t" " 4). Nelson Mandela \n");
scanf("%d",&i);
if(i==2)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 25,00,000\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q13();}}
else
{printf("\n Try Again\n");
play();
}
}
void q13()
{ void life();
void q14();
char k;
printf("\n Your nxt question for Rs 50,00,000 is ---\n");
printf("\n The Oldest living creature on the Earth is ?\n");
printf("\n 1). Plyctyomos " "\t" " 2). Horseshoe Crab \n");
printf("\n 3). Plasmodium " "\t" " 4). Tortoise \n");
printf("\n ------ ATTENTION ------\n");
printf("\n Do you want to use your lifelines?Press y for yes or press any key for no\n");
scanf("%d",&k);
clrscr();
jeevan();
if(k=='k')
{
life();
}
else
{
printf("\n Enter your choice to be locked-\n");
scanf("%d",&i);
if(i==2)
{printf("\n Congratulations ! You win Rs 50,00,000 !!! \n");
printf("\n The moment has come when you are going to be one of the Billioneres !!!!!\n");
printf("\n You are yust a step behind this great milestone !!!!\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q14();}}
else
{printf("\n Try Again\n");
play();
}}
}
void q14()
{
printf("\n Your last question for Rs 1,00,00,000 ! is\n");
printf("\n The author of this Game is ?\n");
printf("\n 1). Amitabh Bachchan " "\t" " 2). Shahrukh Khan \n");
printf("\n 3). Navneet Gautam " "\t" " 4). Sony Channel \n");
scanf("%d",&i);
if(i==3)
{
clrscr();
jeevan();
printf("\n ******** *** ** Congratulations ! You win Rs 1,00,00,000 ** *** ********\n");
printf("\n ******** ** You has become the Lucky player to achieve this feet ** ******\n");
printf("\n ***** **** *** ** Thank You for Playing ** *** **** *****\n");
printf("\n *** *** **** ** Pres Any key to Exit ! ** **** *** *** \n");
}
else
{printf("\n Try Again\n");
play();
}
}
void life()
{
char i,y;
int m,l;
printf("\n Your life lines are a).50-50" "\t" " b). another question\n");
scanf("%d",&i);
if(i=='i')
{
clrscr();
jeevan();
printf("\n Your reducd options are ---\n");
printf("\n 1). Plyctyomos " "\t" " 2). Horseshoe Crab \n");
printf("\n Ente your choice--\n");
scanf("%d",&l);
if(l==2)
{
printf("\n Congratulations ! You win Rs 50,00,000 !!! \n");
printf("\n The moment has come when you are going to be one of the Billioneres !!!!!\n");
printf("\n You are yust a step behind this great milestone !!!!\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();
}
else
{
q14();
}
}
else
{
if(l==1)
{
clrscr();
jeevan();
printf("\n Try Again\n");
play();
}
else
{
printf("\ Wrong Input\n");
life();
}
}
}
else
{if(i=='b')
{
clrscr();
jeevan();
printf("\n Your changed question for Rs 50,00,000 is---\n");
printf("\n 1). Athens,Greece " "\t" " 2). Montreal,Canada \n");
printf("\n 3). Sydney,Australia " "\t" " 4). Los Angeles,U.S.A \n");
scanf("%d",&m);
if(m==1)
{
clrscr();
jeevan();
printf("\n Congratulations ! You win Rs 50,00,000 !!! \n");
printf("\n The moment has come when you are going to be one of the Billioneres !!!!!\n");
printf("\n You are yust a step behind this great milestone !!!!\n");
printf("\n Pres Any key to continue\n");
getch();
printf("\n Do you want to exit? If yes then press y else press other key .\n");
scanf("%c",&y);
clrscr();
jeevan();
if(y=='y')
{
end();}
else
{
q14();}}
else
{printf("\n Try Again\n");
play();
}}
else
{printf("\n Wrong input");
life();}
}
}
void sound()
{
int i;
clrscr();
for(i=0;i<1;i++)
{
sound(222);
delay(1000);
nosound();
}
}
void main()
{
clrscr();
jeevan();
gotoxy(60,17);
printf("\n *********" "\t" "Welcome to Kaun Banega Crorepati" "\t" "********\n");
printf("\n **************" "\t\t" "Press any key to play!" "\t\t" "*************\n");
play();
clrscr();
jeevan();
getch();
}
line2.h is inbuilt or user define header directory?
ReplyDeleteUr knowledge is weak
DeleteUser define header file
ReplyDelete