Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int choice;
- char ans;
- system("cls");
- printf("\nWelcome to The Game of Jepordy\n");
- printf("\nSelect category to play 1) Computing 2) Health: ");
- scanf("%d",&choice);
- if(choice == 1){
- printf("Wise choice, hope you know good about computers!\n");
- }
- else if(choice == 2){
- printf("You'll be fit in no time; Good luck!\n");
- }
- else{
- printf("Incorrect choice :(\n");
- }
- switch(){
- case 1:
- printf("1)What is the hexadecimal value of binary 1010?");
- printf("\n\na. A b. 10 c. 00001010 d. 250");
- printf("\nAnswer: ");
- scanf("%c",&ans);
- if(ans == 'a' || 'A'){
- printf("\n\nCorrect!");
- break;
- }
- else{
- printf("\n\nIncorrect...The answer is A");
- break;
- }
- case 2:
- printf("\n\n2)What is meant by the term 'volatile' in computer memory?");
- printf("\n\na. Is faster b. Is not expensive c. Uses less power d. Saved data is lost upon shutdown");
- printf("\nAnswer: ");
- scanf("%c",&ans);
- if(ans == 'd' || 'D'){
- printf("\n\nCorrect!");
- break;
- }
- else{
- printf("\n\nIncorrect...The answer is D");
- break;
- }
- case 3:
- printf("\n\n3)The brain of any computer system is");
- printf("\n\na. ALU b. Memory c. CPU d. Control Unit");
- printf("\nAnswer: ");
- scanf("%c",&ans);
- if(ans == 'c' || 'C'){
- printf("\n\nCorrect!");
- break;
- }
- else{
- printf("\n\nIncorrect...The answer is C");
- break;
- }
- case 4:
- printf("\n\n4) The binary system uses powers of");
- printf("\n\na. 2 b. 10 c. 8 d. 16");
- printf("\nAnswer: ");
- scanf("%c",&ans);
- if(ans == 'a' || 'A'){
- printf("\n\nCorrect!");
- break;
- }
- else{
- printf("\n\nIncorrect...The answer is A");
- break;
- }
- case 5:
- printf("\n\n5) A computer program that converts assembly language to machine language is");
- printf("\n\na. Runtime Environment b. Command Line c. Assembler d. IDE ");
- printf("\nAnswer: ");
- scanf("%c",&ans);
- if(ans == 'c' || 'C'){
- printf("\n\nCorrect!");
- break;
- }
- else{
- printf("\n\nIncorrect...The answer is C");
- break;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement