C Programming • C17 baseline, standards-specific features labeled
Write and Run Your First C Program
Create a minimal C program and identify its entry point, output call, and return status.
A hosted C program starts at main. The standard I/O header declares puts, which writes a string followed by a newline. Returning zero conventionally reports successful completion to the operating system.
Example
#include <stdio.h>
int main(void) {
puts("Hello from C.");
return 0;
}
What to expect
Hello from C.
Key idea: Include the declaration you use, give main an explicit return type, and make the success path easy to recognize.