#include
#include
void question1();
void main()
{
clrscr();
printf("\n\n\n\n\n\n\t\t\t\t ______________\
\n\t\t\t\t | Hello And WELCOME TO\t|\
\t\t\t\t\t\t\t | KAUN BANEGA\t|\
\t\t\t\t\t\t\t | CROREPATI\t|\
\n\t\t\t\t |______________|\n");
getche();
question1();
getch();
}
char a,b,c,d,A,B,C,D,ans;
void question2();
void question1()
{
clrscr();
fflush(stdin);
printf("\nQ1.What does AC and DC stand for in the electrical field?");
printf("\n A. A Rock Band from Australia\t B. Alternating Current and Direct Current");
printf("\n C. Average Current\t and Discharged Capacitor\
\nD. Atlantic City and District of Columbia ");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'C':
case 'c':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'B':
case 'b':
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.1,000!!");
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'B' || ans == 'b')
{
getche();
clrscr();
question2();
}
}
void question3();
void question2()
{
clrscr();
fflush(stdin);
printf("\nQ2. Sometimes computers and cash registers in a foodmart are connected to a UPS system. What does UPS mean?");
printf("\nA. United Parcel Service \t B. Uniform Product Support");
printf("\nC. Under Paneling Storage\t D.Uninterruptable Power Supply");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'C':
case 'c':
printf("\n\nWRONG ANSWER!!");
break;
case 'D':
case 'd':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.2,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'D' || ans == 'd')
{
getche();
clrscr();
question3();
}
}
void question4();
void question3()
{
clrscr();
fflush(stdin);
printf("Q3.Who is the author of Hamlet?");
printf("\nA. Christopher Marlowe\t B. William Shakespeare");
printf("\nC. Geoffrey Chaucer\\t D. Edith Wharton");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'C':
case 'c':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'B':
case 'b':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.3,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'B' || ans == 'b')
{
getche();
clrscr();
question4();
}
}
void question5();
void question4()
{
clrscr();
fflush(stdin);
printf("Q4.What frequency range is the High Frequency band?");
printf("\nA. 100 kHz\tB. 1GHz");
printf("\nC. 30 to 300 MHz\t D. 3 to 30 MHz");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'C':
case 'c':
printf("\n\nWRONG ANSWER!!");
break;
case 'D':
case 'd':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.5,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'D' || ans == 'd')
{
getche();
clrscr();
question5();
}
}
void question6();
void question5()
{
clrscr();
fflush(stdin);
printf("Q5.What does EPROM stand for?");
printf("\nA. Electric Programmable Read Only Memory\
\n B. Erasable Programmable Read Only Memory")
printf("\n| C. Evaluable Philotic Random Optic Memory \
\n D. Every Person Requires One Mind\t\t\t|");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'C':
case 'c':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'B':
case 'b':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.10,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'B' || ans == 'b')
{
getche();
clrscr();
question6();
}
}
void question7();
void question6()
{
clrscr();
fflush(stdin);
printf("Q6.Which motor is NOT suitable for use as a DC machine?");
printf("\nA. Permanent magnet motor \t B. Series motor");
printf("\nC. Squirrel cage motor \t D. Synchronous motor");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'C':
case 'c':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.25,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'C' || ans == 'c')
{
getche();
clrscr();
question7();
}
}
void question8();
void question7()
{
clrscr();
fflush(stdin);
printf("Q7.Compact discs, (according to the original CD specifications)hold how many minutes of music?");
printf("\nA. 74 mins\t B. 56 mins");
printf("\nC. 60 mins\t D. 90 mins");
scanf("%c",&ans);
switch(ans)
{
case 'B':
case 'b':
case 'C':
case 'c':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'A':
case 'a':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.50,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'A' || ans == 'a')
{
getche();
clrscr();
question8();
}
}
void question9();
void question8()
{
clrscr();
fflush(stdin);
printf("Q8.Who was played by Kenneth Branagh in 'Hamlet' (1996)?");
printf("\n| A. Horatio\t\t |\t B. Laertes\t\t\t|");
printf("\n| C. Polonius\t\t |\t D. Hamlet\t\t\t|");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'C':
case 'c':
printf("\n\nWRONG ANSWER!!");
break;
case 'D':
case 'd':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.1,00,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'D' || ans == 'd')
{
getche();
clrscr();
question9();
}
}
void question10();
void question9()
{
clrscr();
fflush(stdin);
printf("Q9.Which famous national leader of India has written books on the ancient Greek philosopher Socrates and the ancient Roman king Marcus Aurelius?");
printf("\nA. Mahatma Gandhi\t B. Jawaharlal Nehru");
printf("\nC. Bal Gangadhar Tilak\t D. C.Rajagopalachari");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'C':
case 'c':
printf("\n\nWRONG ANSWER!!");
break;
case 'D':
case 'd':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.10,00,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'D' || ans == 'd')
{
getche();
clrscr();
question10();
}
}
void question11();
void question10()
{
clrscr();
fflush(stdin);
printf("\n\nQ10.Sishu is the literary work of which Indian author?");
printf("\nA. Jawaharlal Nehru");
printf("\nB. Arundhati Roy");
printf("\nC. Rabindranath Tagore");
printf("\nD. Vikram Seth \n");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'B':
case 'b':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'C':
case 'c':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.50,00,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'C' || ans == 'c')
{
getche();
clrscr();
question11();
}
}
void question11()
{
clrscr();
fflush(stdin);
printf("\n\nQ11.What was the active medium used in the first working laser ever constructed?");
printf("\nA. Helium-neon gas");
printf("\nB. A ruby rod");
printf("\nC. A diamond block ");
printf("\nD. Carbon dioxide gas\n");
scanf("%c",&ans);
switch(ans)
{
case 'A':
case 'a':
case 'C':
case 'c':
case 'D':
case 'd':
printf("\n\nWRONG ANSWER!!");
break;
case 'B':
case 'b':
{
printf("\n\nCORRECT ANSWER!!");
printf("\n\nYOU WON Rs.1,00,00,000!!");
}
break;
default:
printf("\n\nIMPROPER CHOICE!!");
}
if(ans == 'B' || ans == 'b')
{
getche();
clrscr();
gotoxy(30,8);
printf("CONGRATULATIONS!!\n \
\t Thank you!!");
}
Showing posts with label games in c. Show all posts
Showing posts with label games in c. Show all posts
KAUN BANEGA CROREPATI Game Program in C
Labels:
Basics of C,
C Assignments,
games in c
write a program to draw some basic shapes.
#include
#include
void main()
{
int gd=DETECT, gm;
int poly[12]={350,450, 350,410, 430,400, 350,350, 300,430, 350,450 };
initgraph(&gd, &gm, “”);
circle(100,100,50);
outtextxy(75,170, “Circle”);
rectangle(200,50,350,150);
outtextxy(240, 170, “Rectangle”);
ellipse(500, 100,0,360, 100,50);
outtextxy(480, 170, “Ellipse”);
line(100,250,540,250);
outtextxy(300,260,”Line”);
sector(150, 400, 30, 300, 100,50);
outtextxy(120, 460, “Sector”);
drawpoly(6, poly);
outtextxy(340, 460, “Polygon”);
getch();
closegraph();
}
Related Links :
Labels:
Basics of C,
games in c,
Graphics In C
Runner game in C
#include
#include
#include
void main()
{
int driver=DETECT,mode,j=100,i=0,x1,x22,x2,x11,y1,y11,y2,y22,a,y,k,speed;
float ang1=3.839724354,ang2=5.585053606, c1=0.05,
c2=-0.05,var1=2.967059728,var2=5.410520681,d1=0.072,d2=-0.072,s=2.35619449
;
initgraph(&driver,&mode,"C:\tc\bgi");
printf("
Enter the number of rounds
"); scanf("%d",&k);
printf("
Enter 1 for fast speed or 2 for normal speed
");
scanf("%d",&speed);
if(speed==1) speed=11; else speed=16;cleardevice();delay(1000);
while(k>=1)
{
while(i<=700)
{setcolor(8);
circle(i,j,22);line(i,j+22,i-13,j+115);
x1=i+50*cos(ang1);x2=i+50*cos(ang2);
y1=j+22-50*sin(ang1);y2=j+22-50*sin(ang2);
x11=x1+45*cos(ang1+1.54532952);
x22=x2+45*cos(ang2+1.54532952);
y11=y1-45*sin(ang1+1.54532952);
y22=y2-45*sin(ang2+1.54532952);
setcolor(RED);
line(i,j+22,x1,y1);line(x1,y1,x11,y11);
setcolor(GREEN);
line(i,j+22,x2,y2);
line(x2,y2,x22,y22);
x1=i-15+60*cos(ang1);
x2=i-15+60*cos(ang2);
y1=j+115-60*sin(ang1);
y2=j+115-60*sin(ang2);
x11=x1+60*cos(var1);
x22=x2+60*cos(var2);
y11=y1-60*sin(var1);
y22=y2-60*sin(var2);
line(i-13,j+115,x1,y1);
line(x1,y1,x11,y11);
setcolor(RED);
line(i-13,j+115,x2,y2);
line(x2,y2,x22,y22);
ang1=ang1+c1;
ang2=ang2+c2;
var1=var1+d1;
var2=var2+d2;
if(i==0) a=x22;
if(ang1<=3.839724354)
{
c1=0.05;
var1=2.967059728;d1=0.072;
}
if(ang1>=5.585053606){c1=-0.05;
var1=5.410520681;
d1=-0.072;a=x11+10;
s=2.356
19449;
}
if(ang2<=3.839724354)
{
c2=0.05;
var2=2.967059728;
d2=0.072;
}
if(ang2>=5.585053606)
{
c2=-0.05;
var2=5.410520681;
d2=-0.072;a=x22+10;
s=2.35619449;
}
i=a+150*cos(s)+50;
j=320-150*sin(s)-20;
s=s-0.045;
delay(speed);
if(k!=1)
cleardevice();
}
i=0;
k--;
}
getch();
}
Related Links :
Labels:
games in c,
Graphics In C
Subscribe to:
Posts (Atom)
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
|
More Useful Topics... |
|
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
}

