@ -54,8 +54,13 @@ void timequiz() {
memset(askedQuestions, 0, sizeof(askedQuestions));
srand((unsigned int)time(NULL));
}
int getRandomQuestionIndex(int askedQuestions[], int totalQuestions) {
int questionIndex;
do {
questionIndex = rand() % totalQuestions;
} while (askedQuestions[questionIndex] == 1);
return questionIndex;