Code:
#include <stdio.h>
#include <windows.h>
int main(){
int qz,d;
int me1,me2,me3,me4,me5;
int scr, p,james;
scr = 0;
printf("This is a quiz\n");
printf("1 - MATH \n2 - CS \n3 - DotA\n");
scanf("%d",&qz);
system("cls");
switch (qz){
//////////////////MATH //////////////////
case 1:
printf("you are about to take MATH\n");
printf("Enter Difficulty\n 1 - EASY\n 2 - Moderate\n 3 - HARD\n ");
scanf("%d",&d);
///////EASY////////
switch (d){
case 1:
system("cls");
printf("So You are about To take Math - Difficulty EASY\n");
sleep(1000);
system("cls");
printf("The Test Will Start in 5..\n");
sleep(1000);
system("cls");
printf("The Test Will Start in 4..\n");
sleep(1000);
system("cls");
printf("The Test Will Start in 3..\n");
sleep(1000);
system("cls");
printf("The Test Will Start in 2..\n");
sleep(1000);
system("cls");
printf("The Test Will Start in 1..\n");
sleep(1000);
system("cls");
printf("1 + 1 is?\n");
scanf("%d",&me1);
if (me1 == 2){
scr = scr + 1;
}
printf("2 + 3 is?\n");
scanf("%d",&me2);
if (me2 == 5){
scr = scr + 1;
}
printf("6 + 3 is?\n");
scanf("%d",&me3);
if (me3 == 9){
scr = scr + 1;
}
printf("13 + 17 is?\n");
scanf("%d",&me4);
if (me4 == 30){
scr = scr + 1;
}
printf("24 + 39 is?\n");
scanf("%d",&me5);
if (me5 == 63){
scr = scr + 1;
}
printf("Thank you For taking the Test\n");
printf("Submitting Results, Please wait...");
sleep(5000);
system("cls");
printf("You got %d out the 5 questions\n",scr);
p= ((double)scr/5) * 100;
sleep(1500);
printf("With a percentage of %d\n",p);
system("pause");
break;
As What you Observe, all the answers in the quiz program are NUMBERS.
I know all of you here are PRO programmers and I just wanted to ask help on something Im stuck on since all of you here may just find this unsolve mystery a piece of cake.
What I want to achieve is that instead the answers of the quiz are NUMBERS I want it to Change through WORDS..
Example 1 + 1 = 2 I want it to be 1 + 1 = TWO...
eg
Code:
printf("1 + 1 is?\n");
scanf("%d",&me1);
if (me1 == 2){
scr = scr + 1;
}
printf("2 + 3 is?\n");
scanf("%d",&me2);
if (me2 == 5){
scr = scr + 1;
}
into
Code:
printf("1 + 1 is?\n");
scanf("%d",&me1);
if (me1 == TWO){
scr = scr + 1;
}
printf("2 + 3 is?\n");
scanf("%d",&me2);
if (me2 == 5){
scr = scr + 1;
}
Thanks In advance...