Browse Source

added correct or incorrect if statements-epic game

main
fdlt3885 2 years ago
parent
commit
2657202754
  1. 14
      src/main/quizproject.c

14
src/main/quizproject.c

@ -883,11 +883,25 @@ int B_testround(void) {
printf("Answer: "); printf("Answer: ");
scanf("%s", answer); scanf("%s", answer);
if (strcmp(answer, "a") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is a.\n");
}
printf("Question 2: What is the smallest planet in our solar system?\n"); printf("Question 2: What is the smallest planet in our solar system?\n");
printf("Options: a.)Earth b.)Mars c.)Mercury d.)Sun "); printf("Options: a.)Earth b.)Mars c.)Mercury d.)Sun ");
printf("Answer: "); printf("Answer: ");
scanf("%s", answer); scanf("%s", answer);
if (strcmp(answer, "c") == 0) {
printf("Correct!\n");
score++;
} else {
printf("Incorrect. The answer is c.\n");
}
return score;
} }

Loading…
Cancel
Save