Learning overview
- Estimated time
- 4 minutes
- Difficulty
- Beginner
- Prerequisites
- No prior experience required
- Learning outcome
- Explain c using a clear mental model · Apply c in practical C work
- Last updated
- July 18, 2026
What you will build and learn
You will build a grade calculator that stores a score, decides pass or fail, and prints a clear result. Keep the decision separate from printing so each part stays easy to change.
- Include stdio.h
- Declare an int score
- Use if/else for the pass decision
- Print with printf
Step 1: Create the program skeleton
Every beginner C program needs includes and a main function. main is where execution begins when you press Run.
#include <stdio.h>
int main(void) {
int score = 72;
if (score >= 40) {
printf("Pass\n");
} else {
printf("Try again\n");
}
return 0;
}Output
Pass
Project extensions
Add a second condition for distinction, or read the score with scanf. Keep changes small and re-run after each edit.
- Print Distinction when score >= 75
- Read score with scanf
- Add a second subject average
Frequently asked questions
Do I need an IDE for this tutorial?
No. A simple editor and a C compiler are enough. Avora Learn also lets you practice visually.
Why return 0?
Returning 0 from main traditionally signals successful program completion.
Topic graph
A taxonomy-generated path through this subject.
Related courses
Related learning
Recommended automatically from shared technologies, topics, intent, and difficulty.
Related Guides
Related Tutorials
Related Glossary
Related Cheatsheets
Related Projects
Related Interview Questions
Related reading
Hand-picked companion pages that deepen this topic.
Your next steps
