Structure of C Program

Every C program has a specific structure. The basic structure of a C program is shown below:

Documentation Section

Link Section 

Definition Section

Global Declaration Section

Function Section main() { Declaration Part Executable Part }
Subprogram Section User Defined Functions
Function 1
Function 2
.
.
.
Function n

Documentation Section

Documentation section consists of comments which are used to understand the program information and other details.

Link Section

Link section gives instructions to the compiler to link library files and other user files.

Definition Section

Definition Section defines all symbolic constants.

Global Declaration Section

Some variable and structures need to be used in all functions. These are declared in global declaration section.

Main Function

Every C program must have one main function. It consists of local declarations (which include information that is used only within main) and C statements. All statements end with semicolon.

Subprogram Section

Subprogram section contains all user defined functions that are called in main function. This section may also appear before main although it it is normally placed immediately after main.

Continue Here : Your First C Program "Hello World!"