Browse Source

round 5 with response and answer

main
parent
commit
0b166560ec
  1. 26
      src/main/quizproject.c

26
src/main/quizproject.c

@ -209,6 +209,32 @@ void ask_hard_questions(void) {
} else { } else {
wrong(score); wrong(score);
} }
}
if ( score < 4) {
printf("You lost! Better luck next time\n");
break;
} else {
printf("\t\t--------------------Round 5-------------------\n\n");
printf(">>This is the final round. Good Luck!<<\n\n");
for (int i = 0; i < 2; i++) {
printf("[%d] %s\n", i + 1, questions[i]);
for (int j = 0; j < 4; j++) {
printf("%s\n", options[i][j]);
}
printf("Enter your answer (A, B, C, or D): ");
char response;
scanf(" %c", &response);
response = toupper(response);
user_answers[i] = response;
// check each answer
if (user_answers[i] == answers[i]) {
score++;
correct(score);
} else {
wrong(score);
}
}
} }
k++; k++;
} }

Loading…
Cancel
Save