Last active
January 1, 2019 13:36
-
-
Save winhtut/5dc597318a98998a4b0b5677c6ffeebe to your computer and use it in GitHub Desktop.
Myat Noe Zar Chi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int age=0; | |
int a=0; | |
int data=0; | |
int currentmoney=2000; | |
printf("Welcome to the questionnaire\n "); | |
printf("Please enter your age.\n"); | |
scanf("%d",&age); | |
if(age>14){ | |
printf("Your current money is 2000\n You lose 1000 everytime you are wrong.\n"); | |
while(age>14){ printf("Who is the inventor of radio?\n"); | |
printf("1.Alexander Graham Bell\n 2.Thomas Alva Edison\n 3.Guglielmo Marconi\n"); | |
printf("Please only enter the number of the answer.\n Your answer is "); | |
scanf("%d",&a); | |
if(a==3) { | |
printf("You are correct.\n"); | |
currentmoney=currentmoney+1000; | |
printf("You have %d\n",currentmoney); | |
}else{ | |
printf("You are wrong.\n"); | |
currentmoney=currentmoney-1000; | |
printf("You have %d\n",currentmoney); | |
} | |
printf("Who wrote the Wuthering Heights?\n"); | |
printf("1.Emily Bronte\n 2.Charlotte Bronte\n 3.Jane Eyre\n Your answer is "); | |
scanf("%d",&a); | |
if(a==1){ | |
printf("You are correct\n"); | |
currentmoney=currentmoney+1000; | |
printf("You have %d\n",currentmoney); | |
}else{ | |
printf("You are wrong.\n"); | |
currentmoney=currentmoney-1000; | |
if(currentmoney<1000){ | |
printf("I am sorry.You have lost the game\n"); | |
exit(0); | |
} | |
} | |
printf("Where did William the Conquerer came from?\n 1. England\n 2.Normandy\n 3.Germany\n Your answer is "); | |
scanf("%d",&a); | |
if(a==2){ | |
printf("You are correct.\n"); | |
currentmoney=currentmoney+1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney==5000){ | |
printf("You are a genius.\n You have already won the game."); | |
} | |
}else{ | |
printf("You are wrong.\n"); | |
currentmoney=currentmoney-1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney<1000){ | |
printf("You have lost the Game"); | |
exit(0); | |
} | |
} | |
printf("Where was Alfred Nobel born?\n 1.Denmark \n 2.Netherlands\n 3.Sweden\n Your answer is "); | |
scanf("%d",&a); | |
if(a==3){ | |
printf("You are correct\n"); | |
currentmoney=currentmoney+1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney==5000){ | |
printf("You have won the game.Good job!\n"); | |
} | |
}else{ | |
printf("You are wrong.\n"); | |
currentmoney=currentmoney-1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney<1000){ | |
printf("You have lost the game.\n"); | |
exit(0); | |
}else{ | |
printf("Try harder\n");} | |
} | |
printf("what is the formula for Pressure?\n 1.Pressure = Force divided by Area \n 2.Pressure=Force*Area\n 3.Pressure=Area divided by Force\n"); | |
scanf("%d",&a); | |
if(a==1){ | |
printf("You are correct\n"); | |
currentmoney=currentmoney+1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney==5000){ | |
printf("You have won the game.\n"); | |
printf("Good job!\n"); | |
exit(0); | |
}else{ | |
printf("Goodbye"); | |
} | |
if(currentmoney<1000){ | |
printf("If you want to play again Press 1\n If you want to quit press 2.\n"); | |
scanf("%d",&data); | |
if(data==1){ | |
printf("You can continue\n"); | |
}else{ | |
printf("Bye Bye!\n"); | |
exit(0);} | |
}else{ | |
printf("You are wrong\n"); | |
currentmoney=currentmoney-1000; | |
printf("You have %d\n",currentmoney); | |
if(currentmoney>2000){ | |
printf("Good job\n Would you like to play again?\n If you want to, Press 1\n If you don't want to Press 2.\n"); | |
scanf("%d",&data); | |
if(data=1){ | |
printf("Please continue");} | |
else{ | |
printf("Goodbye");} | |
}else{ | |
printf("You lost the Game. Read More"); | |
exit (0); | |
} | |
} | |
} | |
} | |
}else{ | |
printf("You cannot play the game"); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment