From 2657202754efdf54880cefd54c387537a2463644 Mon Sep 17 00:00:00 2001 From: fdlt3885 Date: Tue, 31 Jan 2023 22:10:13 +0000 Subject: [PATCH] added correct or incorrect if statements-epic game --- src/main/quizproject.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/quizproject.c b/src/main/quizproject.c index 34fd95f..f2bbcfa 100644 --- a/src/main/quizproject.c +++ b/src/main/quizproject.c @@ -883,11 +883,25 @@ int B_testround(void) { printf("Answer: "); scanf("%s", answer); + if (strcmp(answer, "a") == 0) { + printf("Correct!\n"); + score++; + } else { + printf("Incorrect. The answer is a.\n"); + } + printf("Question 2: What is the smallest planet in our solar system?\n"); printf("Options: a.)Earth b.)Mars c.)Mercury d.)Sun "); printf("Answer: "); scanf("%s", answer); + if (strcmp(answer, "c") == 0) { + printf("Correct!\n"); + score++; + } else { + printf("Incorrect. The answer is c.\n"); + } + return score; }