|
@ -89,4 +89,12 @@ void displayQuestion(char* question, char* answers[], int correctIndex) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]) { |
|
|
void processUserAnswer(int userAnswer, int correctIndex, int* score, int* totalCorrectAnswers, char* answers[]) { |
|
|
|
|
|
if (userAnswer == correctIndex + 1) { |
|
|
|
|
|
printf("Correct!\n"); |
|
|
|
|
|
(*score)++; |
|
|
|
|
|
(*totalCorrectAnswers)++; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
printf("Wrong! The correct answer is: %d. %s\n", correctIndex + 1, answers[correctIndex]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |