Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.  
  6. int choice;
  7. char ans;
  8. system("cls");
  9. printf("\nWelcome to The Game of Jepordy\n");
  10. printf("\nSelect category to play 1) Computing 2) Health: ");
  11. scanf("%d",&choice);
  12.  
  13. if(choice == 1){
  14.     printf("Wise choice, hope you know good about computers!\n");
  15. }
  16. else if(choice == 2){
  17.     printf("You'll be fit in no time; Good luck!\n");
  18. }
  19. else{
  20.     printf("Incorrect choice :(\n");
  21. }
  22.  
  23.  
  24. switch(){
  25.     case 1:
  26.         printf("1)What is the hexadecimal value of binary 1010?");
  27.         printf("\n\na. A  b. 10  c. 00001010 d. 250");
  28.         printf("\nAnswer: ");
  29.         scanf("%c",&ans);
  30.         if(ans == 'a' || 'A'){
  31.             printf("\n\nCorrect!");
  32.             break;
  33.         }
  34.         else{
  35.             printf("\n\nIncorrect...The answer is A");
  36.             break;
  37.         }
  38.        
  39.     case 2:
  40.         printf("\n\n2)What is meant by the term 'volatile' in computer memory?");
  41.         printf("\n\na. Is faster  b. Is not expensive  c. Uses less power  d. Saved data is lost upon shutdown");
  42.         printf("\nAnswer: ");
  43.         scanf("%c",&ans);
  44.         if(ans == 'd' || 'D'){
  45.             printf("\n\nCorrect!");
  46.             break;
  47.         }
  48.         else{
  49.             printf("\n\nIncorrect...The answer is D");
  50.             break;
  51.         }
  52.  
  53.     case 3:
  54.         printf("\n\n3)The brain of any computer system is");
  55.         printf("\n\na. ALU  b. Memory  c. CPU  d. Control Unit");
  56.         printf("\nAnswer: ");
  57.         scanf("%c",&ans);
  58.         if(ans == 'c' || 'C'){
  59.             printf("\n\nCorrect!");
  60.             break;
  61.         }
  62.         else{
  63.             printf("\n\nIncorrect...The answer is C");
  64.             break;
  65.         }
  66.  
  67.     case 4:
  68.         printf("\n\n4) The binary system uses powers of");
  69.         printf("\n\na. 2  b. 10  c. 8  d. 16");
  70.         printf("\nAnswer: ");
  71.         scanf("%c",&ans);
  72.         if(ans == 'a' || 'A'){
  73.             printf("\n\nCorrect!");
  74.             break;
  75.         }
  76.         else{
  77.             printf("\n\nIncorrect...The answer is A");
  78.             break;
  79.         }
  80.  
  81.     case 5:
  82.         printf("\n\n5) A computer program that converts assembly language to machine language is");
  83.         printf("\n\na. Runtime Environment b. Command Line c. Assembler  d. IDE ");
  84.         printf("\nAnswer: ");
  85.         scanf("%c",&ans);
  86.         if(ans == 'c' || 'C'){
  87.             printf("\n\nCorrect!");
  88.             break;
  89.         }
  90.         else{
  91.             printf("\n\nIncorrect...The answer is C");
  92.             break;
  93.         }
  94. }
  95.  
  96. system("pause");
  97. return 0;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement