From fb9bf1bac93bbe3f3b9a40f80d6e309729269b8d Mon Sep 17 00:00:00 2001 From: fdlt3914 Date: Tue, 31 Jan 2023 02:55:01 +0000 Subject: [PATCH] correct/wrong output and scores --- src/main/quizproject.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index dfce924..5715950 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -65,6 +65,15 @@ void e_t_f_printQuestions(char askquestion[][100],char answers[]) { user_answer = toupper(user_answer); } } + bool ans = e_true_false(user_answer); + if(ans == answers[i]) { + score++; + printf("Correct!\n"); + printf("You have %d score\n\n", score); + } else{ + printf("Wrong!\n"); + printf("You have %d score\n\n", score); + } } printf("\t\t---------------------------Round2-----------------------------\n"); printf("\t\t >>In this round you will be presented with 2 questions.<<\n"); @@ -82,6 +91,15 @@ void e_t_f_printQuestions(char askquestion[][100],char answers[]) { user_answer = toupper(user_answer); } } + bool ans = e_true_false(user_answer); + if(ans == answers[i]) { + score++; + printf("Correct!\n"); + printf("You have %d score\n\n", score); + } else{ + printf("Wrong!\n"); + printf("You have %d score\n\n", score); + } } }