Hello, World
A main function, #include <stdio.h> and printf.
Runs in Zerethon IDE · C (GCC 14)
Official C documentation ↗
main.c
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
printf("Sum: %d\n", 2 + 3);
puts("puts adds the newline itself");
return 0;
}
Output
Hello, World! Sum: 5 puts adds the newline itself
printfdoes not add a newline: end the text with\n.return 0;frommainmeans success; any other value is shown as the exit code.- Each
#includebrings in the declarations of a standard header (<stdio.h>for input/output,<string.h>,<stdlib.h>,<math.h>, …).