diff --git a/src/timequiz.c b/src/timequiz.c index 5a78f6d..41f2aa3 100644 --- a/src/timequiz.c +++ b/src/timequiz.c @@ -153,6 +153,11 @@ void timequiz() { printf("Answer (1-4): "); scanf_s("%d", &userAnswer); + while (!isValidAnswer(userAnswer)) { + printf("Invalid input. Please enter a number between 1 and 4: "); + scanf_s("%d", &userAnswer); + } + processUserAnswer(userAnswer, correctIndex, &score, &totalCorrectAnswers, answers[questionIndex]); totalAnsweredQuestions++;