hello.c

The hello program displays a message on the screen using the printf function, then exits. printf is defined in the stdio.h library of input/output functions. That is why we use #include directive.

Note the structure of the program: include directives, followed by the definition of the function main. The body of the function --- the working part of the definition --- is the part enclosed in curly braces. Note also the comments: the text enclosed /* like this */. Comments are meant to enlighten the human reader; the compiler ignores them.

/* hello.c: display a message on the screen */

#include <stdio.h>

main()
{
	printf("hello, world\n");
}