forked from pratyushmp/code_opensource_2020
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuiz_game.c
More file actions
313 lines (293 loc) · 15.2 KB
/
Copy pathQuiz_game.c
File metadata and controls
313 lines (293 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
last:;
int score=0;
int ch,ch2;
int i,j,k;
char choice[20];
printf("\n____________________________________________________________");
printf("\n____________________________________________________________");
printf("\n\n\t * * * WELCOME TO ELITE QUIZ GAME CLUB * * *\n");
printf("\n____________________________________________________________");
printf("\n\t\t\t---- MAIN MENU ----");
printf("\n\n\t-> Press S to start the Quiz Game");
printf("\n\t-> Press E to Exit");
printf("\n____________________________________________________________");
printf("\n____________________________________________________________\n");
if(toupper(getch())=='S')
{
{
printf("\n\t\tINSTRUCTIONS FOR PLAYING ELITE QUIZ GAME \n");
printf("\n\t1. There are 2 rounds in this Quiz Game.");
printf("\n\t2. In first round You will be asked 4 questions.");
printf("\n\t3. For each question You will be given 4 options and you have to press A, B ,C or D for the right answer.");
printf("\n\t4. You are eligible to play the second round if you give at least 2 correct answers of questions from");
printf("\n\t first round.");
printf("\n\t5. Total Score will be displayed after playing round 2\n");
printf("\n\t\tPress any key to continue or Press M to return MAIN MENU : \n");
if(toupper(getch())=='M')
{
goto last;
}
}
printf("\n\t\t|||| ROUND 1 ||||\n");
printf("\n____________________________________________________________");
for(i=1;i<=4;i++)
{
ch=i;
switch(ch)
{
case 1:
printf("\nQ.1)What is the name of the national animal of New Zealand?\n ");
printf("\n\nA. Kangaroo.\t\tB. Kiwi.\nC. Tuatara.\t\tD. Yellow-eyed Penguin.\n\n ");
printf("Select your option:- ");
if(toupper(getch())=='B')
{
printf("\n\n\tB. Kiwi is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is B. Kiwi ");
}
printf("\n____________________________________________________________");
break;
case 2:
printf("\nQ.2)Which team was the runner-up in FIFA 2018 World Cup?\n");
printf("\n\nA. Croatia\t\tB. France\nC. Germany\t\tD. Brazil\n\n");
printf("Select your option:- ");
if(toupper(getch())=='A')
{
printf("\n\n\tA. Croatia correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is A. Croatia");
}
printf("\n____________________________________________________________");
break;
case 3:
printf("\nQ.3)Who had developed C Language? \n");
printf("\n\nA. Andy Rubin\t\tB. Tim Berners-lee\nC. Dennis Ritchie\tD. Guido van Rossum\n\n");
printf("Select your option:- ");
if(toupper(getch())=='C')
{
printf("\n\n\tC. Dennis Ritchie is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is C. Dennis Ritchie ");
}
printf("\n____________________________________________________________");
break;
case 4:
printf("\nQ.4)Which gas is most popular as laughing gas? \n");
printf("\n\nA. Nitric Chloride\tB. Sulphuric Oxide\nC. Zinc Chloride\tD. Nitrous Oxide\n\n");
printf("Select your option:- ");
if(toupper(getch())=='D')
{
printf("\n\n\tD. Nitrous Oxide correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is D. Nitric Oxide ");
}
printf("\n____________________________________________________________");
break;
}
}
if(score>=2)
{
printf("\n____________________________________________________________");
printf("\n\tCongrats You are eligible for Second Round !!!\n");
printf("\t\tSCORE: %d ",score);
printf("\n\n\tTo continue press C\n");
if(toupper(getch())=='C')
{
printf("\n____________________________________________________________");
printf("\n\t\t|||| ROUND 2 ||||");
printf("\n____________________________________________________________");
for(j=1;j<=12;j++)
{
ch2=j;
switch(ch2)
{
case 1:
printf("\nQ.5)Who was the First Lady of USA? \n");
printf("\n\nA. Hillary Washington\t B. Michelle Obama\nC. Martha Washington\t D. Hillary Clinton\n\n");
printf("Select your option:- ");
if(toupper(getch())=='C')
{
printf("\n\n\tC. Martha Washington is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is C. Martha Washington ");
}
printf("\n____________________________________________________________");
break;
case 2:
printf("\nQ.6)What is the SI unit of current? \n");
printf("\n\nA. Ampere\tB. Coulomb\nC. Watt\t\tD. voltage\n\n");
printf("Select your option:- ");
if(toupper(getch())=='A')
{
printf("\n\n\tA. Ampere is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is A. Ampere ");
}
printf("\n____________________________________________________________");
break;
case 3:
printf("\nQ.7)Which of the following is a Palindrome number\n");
printf("\n\nA. 23232\t\tB. 101010\n\nC. 42042\t\tD. 01234\n\n");
printf("Select your option:- ");
if(toupper(getch())=='A')
{
printf("\n\n\tA. 23232 is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is A. 23232.");
}
printf("\n____________________________________________________________");
break;
case 4:
printf("\nQ.8)Among the following elements,which one is essential for the transmission of impulsesin the nerve fibre? \n");
printf("\n\nA. Zinc\t\tB. Iron\nC. Sodium\tD. Calcium\n\n");
printf("Select your option:- ");
if(toupper(getch())=='D')
{
printf("\n\n\tD. Calcium is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is D. Calcium");
}
printf("\n____________________________________________________________");
break;
case 5:
printf("\nQ.9)The Renaissance scientist who explained how planets move around the sun? \n");
printf("\n\nA. Kepler\t\tB. Rabelais\nC. Francis Bacoor\tD. Gutenberg\n\n");
printf("Select your option:- ");
if(toupper(getch())=='A')
{
printf("\n\n\tA. Kepler is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is A. Kepler");
}
printf("\n____________________________________________________________");
break;
case 6:
printf("\nQ.10)Which of the following is an enzyme? \n");
printf("\n\nA. Glucagon\tB. Insulin\nC. Somatotropin\tD. Trypsin\n\n");
printf("Select your option:- ");
if(toupper(getch())=='D')
{
printf("\n\n\tD. Trypsin is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is D. Trypsin ");
}
printf("\n____________________________________________________________");
break;
case 7:
printf("\nQ.11)Who is known as father of Modern Medicine? \n");
printf("\n\nA. Euclid\tB. Pythagoras\nC. Hippocrates\tD. Eratosthenes\n\n");
printf("Select your option:- ");
if(toupper(getch())=='C')
{
printf("\n\n\tC. Hippocrates is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is C. Hippocrates ");
}
printf("\n____________________________________________________________");
break;
case 8:
printf("\nQ.12)When did World War 2 started? \n");
printf("\n\nA. 1937\t\tB. 1939\nC. 1938\t\tD. 1940\n\n");
printf("Select your option:- ");
if(toupper(getch())=='B')
{
printf("\n\n\tB. 1939 is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is B. 1939 ");
}
printf("\n____________________________________________________________");
break;
case 9:
printf("\nQ.13)What is the capital of Netherlands? \n");
printf("\n\nA. Paris\tB. Amsterdam\nC. Hague\tD. Venice\n\n");
printf("Select your option:- ");
if(toupper(getch())=='B')
{
printf("\n\n\tB. Amsterdam is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is B. Amsterdam");
}
printf("\n____________________________________________________________");
break;
case 10:
printf("\nQ.14)Which team won the ODI World Cup 2007? \n");
printf("\n\nA. Australia\tB. India\nC. Sri Lanka\tD. England\n\n");
printf("Select your option:- ");
if(toupper(getch())=='A')
{
printf("\n\n\tA. Australia is correct!!! ");
score++;
}
else
{
printf("\n\n\tWrong!!!,correct answer is A. Australia");
}
printf("\n____________________________________________________________");
break;
case 11:
printf("\n\n\t\tTOTAL SCORE : %d",score);
printf("\n____________________________________________________________");
printf("\n____________________________________________________________");
break;
case 12:
printf("\n\tPress M for MAIN MENU\n");
if(toupper(getch())=='M')
{
goto last;
}
}
}
}
}
else
{
printf("\n\n\tSorry You are not eligible for next round !!!!\n");
printf("\tYour score is : %d",score);
}
}
return 0;
}