Add Score Var

This commit is contained in:
Michał 2024-04-10 23:58:40 +01:00
parent bf7aa9194b
commit 99310a46f1

12
main.c
View file

@ -1,20 +1,22 @@
#include <stdio.h>
int main() {
char characterName;
int characterAge;
int score = 0;
char playerName;
int playerAge;
printf("Welcome to my quiz!\n");
printf("What is your name: ");
scanf("%s", &characterName);
scanf("%s", &playerName);
printf("\n");
printf("What is your age: ");
scanf("%d", &characterAge);
scanf("%d", &playerAge);
printf("\n");
printf("Hello %c! You are %d years old.\n", characterName, characterAge);
printf("Hello %c! You are %d years old. Your current score is: %d", playerName, playerAge, score);
return 0;
}