The smallest useful C program prints a line, then exits.
Hello World is the smallest useful C program: it prints one line and exits. You use it to prove the compiler, the editor, and the terminal are all talking to each other.
printf is declared.main — that is the start of every hosted C program.printf("Hello, Kodin!\n").bring in printf from stdio.h
Without this header, gcc may warn or error.the OS starts here
Every hosted C program needs an entry point.write characters to stdout
A newline ends the line so the next prompt is clean.success status
Shells treat 0 as 'it worked'.Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. Why include stdio.h here?
Headers declare functions you call.
2. What does the n after the backslash in the format string do?
It is the newline escape.
3. If you omit the newline, what is a likely annoyance?
The shell prompt may sit on the same line.
4. How many times does this program call printf?
One call, then return.
5. Is Hello World interpreted or compiled in C?
Compile, then run.