SUMMER PROJECT
C-Code on Quiz game
By
The Students of Diploma Science and
Engineering
Mahitha Vejendla Kota Naga Navaneeth Reddy
(231FE04023) (231FE04026)
Markapudi Karthik Shaik Asma Mohammad
(231FE04029) (231FE04051)
Under the Guidance of
Dr. S. K. Satpathy
Directorate of Polytechnic Education
VFSTR(Deemed to be University)
Contents
Introduction
System Requirements
About
How to Play
Advantages
Rules
Algorithm
Flowchart
Source Code
Output
Conclusion
INTRODUCTION
This C program implements a dynamic and interactive
quiz game designed to test the user’s knowledge
across various topics. As the user progresses through
the quiz, their responses are evaluated and a running
score is maintained. Upon completion, the user
receives immediate feedback on their performance,
making the quiz both educational and engaging. This
project is an example for basic C programming
concepts such as arrays, functions etc., offering an
excellent learning opportunity for beginners.
HARDWARE REQUIREMENTS:
• Processor: Any modern processor that supports C
compilation.
• Memory: At least 1MB of free RAM.
• Storage: Minimal storage required approximately 1 MB.
SOFTWARE REQUIREMENTS:
• Operating System: Can run on any OS that supports a
C compiler.
• C-Compiler: A standard C compiler which includes
GCC, Clang etc.
OVERVIEW: This interactive quiz game is designed to challenge
and expand your general knowledge through a series of multiple-
choice questions across various topics. The game is implemented
in C, making it a great example for those learning fundamental
programming concepts.
GAMEPLAY: Upon starting the game, you are greeted with a
welcome message and introduced to the quiz format. You will be
presented with a set of questions, each with four possible answers.
For each question, you must enter the number corresponding to
your chosen answer. Your input is immediately evaluated, and you
are informed whether your answer is correct or incorrect. The
correct answer is displayed for every question, providing instant
feedback and learning opportunities.
How to Play
ADVANTAGES
Knowledge Enhancement
Engaging Learning
Modular Code Design
Algorithm Implementation
Diverse Question Set
Low System Requirements
Project-Based Learning
Community and Collaboration
Educational Benefits
Social Skills
RULES OF QUIZ GAME
The game begins with a welcome message.
You will be presented with a series of multiple-
choice questions, each with four possible answers.
For each question, read the question and the four
options carefully.
Enter the corresponding number to the option you
believe is correct.
Press Enter to submit your answer.
You will receive 1 point for each correct answer.
After submitting an answer, the game will inform
you whether your answer is correct or incorrect.
If your answer is incorrect, the correct answer will
be displayed.
o The quiz consists of predefined number of
questions.
o After all questions have been answered,
your final score will be displayed.
o You will receive feedback based on your
score to indicate your overall performance.
o Answer honestly without external help to
get an accurate assessment of your
knowledge.
o Have fun and use the game as a learning
tool to improve your knowledge on various
topics
ALGORITHM
Step-1:
Start
Step-2:
Take two variables - score and answer
Step-3:
Initialize score as „score=0‟
Step-4:
Print Welcome Message
Step-5:
Print the Questions
Step-6:
Print four options for each question
Step-7:
Ask the user for input
Step-8:
Read the user‟s input into user‟s answer
Step-9:
If user‟s answer equals to correct answer
Print “Correct!”
Increment Score
Step-10: Else
Print “Wrong! The Correct answer is:” followed by
the correct option
Step-11: Print “Quiz Over! Your final score is:” followed by
your score and “out of” followed by the number
of Questions
Step-12: Provide Performance Feedback based on your
score
Step-13: If Score==Number of Questions
Print “Excellent!! You got all questions right!”
Step-14: Else if Score>=Number of Questions/2
Print “Good Job!! You got more than half right!
Step-15: Else
Print “Better Luck Next Time”
Step-16: Display End Message
Step-17: Stop
FLOWCHART
Start
Take two variables
score, answer
Initially input value
for score as „score=0‟
Print Welcome
Message
Define Questions, Options and
Correct answers
for (each question
from 0 to [Link]
questions-1)
Display Questions
and Options
Ask User for
answer
Read User‟s answer
if(User‟s
answer==Correct
answer)
Print Print
Correct Wrong
Increment Display Correct
score Answer
Print Final
Score
Provide Performance
Feedback
if(Score==
Print
[Link]
“Excellent”
Questions
else
Print “Good
if(Score>=[Link]
Job”
Questions/2)
Print “Better
Luck Next Time”
Display End
Message
Stop
SOURCE CODE
#include<stdio.h>
int main()
{
int score=0;
int answer;
printf("Welcome to the Quiz Game!\n");
printf("You will be asked 3 questions. Each correct
answer gives you 1 point.\n\n\n\n");
//Question 1
printf("Question 1: Who is the founder of C-Language?\n");
printf("1. Charles Babbage\n");
printf("2. John Warner Backus\n");
printf("3. Dennis Ritchie\n");
printf("4. Grace Murray\n");
printf("Enter your answer:");
scanf("%d",&answer);
if(answer==3)
{
printf("Correct!\n\n");
score++;
}
else
{
printf("Wrong! The Correct answer is 3. Dennis
Ritchie\n\n");
}
//Question 2
printf("Question 2: When was the C-Language
developed?\n");
printf("1. 1960\n");
printf("2. 1972\n");
printf("3. 1989\n");
printf("4. 1992\n");
printf("Enter your answer:");
scanf("%d",&answer);
if(answer==2)
{
printf("Correct!\n\n");
score++;
}
else
{
printf("Wrong!The Correct answer is 2. 1972\n\n");
}
//Question 3
printf("Question 3: A collection of 8 bits is called?\n");
printf("1. Word\n");
printf("2. Bit\n");
printf("3. Record\n");
printf("4. Byte\n");
printf("Enter your answer:");
scanf("%d",&answer);
if(answer==4)
{
printf("Correct!\n\n");
score++;
}
else
{
printf("Wrong!The Correct answer is 4. Byte\n\n");
}
//Final score
printf("Quiz Over! Your Final score is:%d out of
3\n\n",score);
if(score==3)
{
printf("Excellent!!You got all questions right!\n");
}
else if(score==2)
{
printf("Good job! You got more than half
right!");
}
else
{
printf("Better Luck Next Time!!\n");
}
printf("Thank You for playing the Quiz Game!");
return 0;
}
OUTPUT
In summary, this simple quiz game in C offers a
fun and interactive way to test general knowledge
while learning fundamental programming concepts.
It serves as an excellent project for beginners to
practice data structures, control flow, and user
interaction in C programming. Overall, this quiz
game is a practical and enjoyable application that
enhances both knowledge and coding skills.
In Conclusion
THANK YOU