basics · beginner · ~15 min
Confirm your C toolchain works end-to-end: compile, link, run, exit 0.
Every C journey starts here. The goal isn't the print — it's confirming that your toolchain works: the compiler is installed, the source compiles, the binary runs, and your terminal speaks UTF-8.
Write a complete program that prints exactly:
Hello, World!
…followed by a single newline (\n).
int main(void);
A single line: Hello, World!. Nothing before, nothing after.
printf from <stdio.h> (not puts, not write — printf is the canonical first call).0 so the OS knows the program succeeded.| stdin | stdout |
|---|---|
| (none — this program takes no input) | Hello, World!\n |
\n matters. The grader compares byte-for-byte.Hello-world is the smallest possible proof that your environment is real. Skip it and you'll spend an hour debugging an exercise when the actual problem was a missing #include.
No input.
Hello, World! followed by a newline.
Use printf. Return 0.
#include <stdio.h>
int main(void) {
/* TODO: print Hello, World! */
return 0;
}
Missing #include <stdio.h> (compiler can't find printf). Forgetting the \n at the end. Using print (Python habit) or cout (C++ habit).
Off-by-one whitespace. Mismatched newline. Trailing space before the \n.
O(1) — just a single call to printf.
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.