Simple Quiz Game in C #coding #gaming #code #coder #cprogramming #tutorial #developer

preview_player
Показать описание
Learn how to create a simple quiz game in C @codetek.

Code Source:
Simple Game in C
#include

int main() {
int score = 0;

printf("Welcome to the Quiz Game!\n");

printf("Question 1: What is the capital of France?\n");
printf("A) Madrid\nB) Paris\nC) Rome\nD) Berlin\n");

char answer1 = 'B';

printf("Your answer: ");
char userAnswer1;

scanf(" %c", &userAnswer1);
if (userAnswer1 == answer1) {
printf("Correct!\n");
score++;
} else {
printf("Wrong!\n");
}

// Add more questions and answers...

printf("Your score: %d out of 5\n", score);
return 0;
}
Рекомендации по теме
Комментарии
Автор

What if im making like a buzzfeed type quiz? Where theres no right or wrong answer but i want your answers to lead to a result.
Could anyone tell me what to search for to find info on that?

sasariwtf
join shbcf.ru