Hello World in C

From the C cheat sheet · Getting Started · verified Jul 2026

Hello World

The entry point and printf.

c
// Quick Reference
#include <stdio.h>

int main(void) {
    printf("Hello, World!\n");
    return 0;
}
💡 Every C program starts at main(); return 0 signals success to the OS.
⚡ printf uses format specifiers: %d int, %f double, %c char, %s string, %p pointer.
📌 scanf needs the address of the variable (&age) - it writes through a pointer.
🟢 Always #include the header that declares a function (<stdio.h> for printf).
basicsio

More C tasks

Back to the full C cheat sheet