C is a compiled programming language built around functions, variables, expressions and statements. A beginner can start with a small main() function, print output with printf(), read input with scanf(), and then move into conditions, loops, arrays and functions.
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}
Output
Hello, World!
#include <stdio.h> makes the standard input/output declarations available. Program execution begins in main(), and return 0; reports successful completion to the operating environment.
| Topic | What you will learn |
|---|---|
| Structure of a C program | Headers, main(), statements, comments and return value |
| Constants and variables | Storing values and using const |
| Local, global and static variables | Scope and lifetime |
| Data types | char, integer types, floating types and format specifiers |
| Operators | Arithmetic, relational, logical, assignment and increment operators |
| printf() | Formatted output |
| scanf() | Formatted keyboard input |
| Comments | Single-line and block comments |
| Functions | Creating and calling user-defined functions |
| if...else | Conditional execution |
| switch | Choosing among several cases |
| for loop | Count-controlled repetition |
| while loop | Condition-controlled repetition |
| do...while loop | Run the loop body before testing the condition |
| getchar() / putchar() | Character input and output |
#include <stdio.h>
int main(void) {
int age;
printf("Enter your age: ");
scanf("%d", &age);
printf("Age: %d\n", age);
return 0;
}
The ampersand in &age passes the address where scanf() should store the integer.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.