Hello World in C

Hello World is the typical minimum-function program that prints a message and exits successfully. This is an example written in C.

 

The first line imports function declarations including printf. The next line starts the definition of the main function, which is called when your program is run. The curly braces enclose the contents of the main function. The printf call does the actual printing. The exit(0); line exits main successfully. It could have just as easily have said return 0;, but the intent of exit</tt> is more clear.