Skip to main content

Kaun Banega Crorepati in c language

                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();
}
                                  

                                    HEADER FILE

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
void jeevan()
{
  int i,b=60,c=1,w=1,e=17;

   /* request auto detection */
   int gdriver = DETECT,gmode, errorcode;
   int midx,midx1, midy,midy1,left, top, right, bottom;
   int radius = 100,radius1 = 120;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "c:\\tc\bgi");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

   midx = getmaxx() / 2.7;
   midy = getmaxy() / 3.9;
   midx1=getmaxx()/2.7;
   midy1=getmaxy()/3.9;
   setcolor(getmaxcolor());

   /* draw the circle */
   circle(midx, midy, radius);
  circle(midx1, midy1, radius1);
  rectangle(left,top,right,bottom);


left = getmaxx() / 2 - 50;
top = getmaxy() / 2 - 50;
right = getmaxx() / 2 + 50;
bottom = getmaxy() / 2 + 50;
   /* clean up */

line(500,0,500,260);

gotoxy(65,2);
printf("10000000");
gotoxy(65,3);
printf("5000000");
gotoxy(65,4);
printf("2500000");
gotoxy(65,5);
printf("1250000");
gotoxy(65,6);
printf("720000");
gotoxy(65,7);
printf("360000");
gotoxy(65,8);
printf("240000");
gotoxy(65,9);
printf("120000");
gotoxy(65,10);
printf("50000");
gotoxy(65,11);
printf("20000");
gotoxy(65,12);
printf("5000");
gotoxy(65,13);
printf("2000");
gotoxy(65,14);
printf("1000");
line(0,260,638,260);
gotoxy(20,8);
printf("KAUN BANEGA CROREPATI\n\n\n\n\n\n\n\n\n\n\n\n");
getch();
}

Comments

Post a Comment

Popular posts from this blog

DAY COUNTER

WRITE A PROGRAM TO COUNT YOUR DATE MONTH YEAR IN CURRENT TIME #include<stdio.h> #include<conio.h> void main() { int yy,mm,dd,y,m,d,day,month,year; clrscr(); printf("enter actual date:(dd/mm/yyyy):"); scanf("%d%d%d",&dd,&mm,&yy); printf("enter your date of birth:(dd/mm/yyyy);"); scanf("%d%d%d",&d,&m,&y); if(dd<d) { day=(dd+30)-d; mm=mm-1; } else { day=dd-d; } if(mm<m) { month=(mm+12)-m; yy=yy-1; } else { month=mm-m; } year=yy-y; printf("now you are:%d year%d month%d day:",year,month,day); getch(); }
Android Login View with Video Download Full Source Code