Structure of a C Program

The Documentation Section– consists of a set of comment lines giving the name of the program and other details.

The Link Section– provides instructions to the compiler to link functions from the system library.

The Definition Section– defines all symbolic constants.

The Global Declaration Section- There are some variables and those variables are declared in this section that is outside of all functions.

main() function- Every C program must have one main function section. This section contains two parts, declaration and executable part.
Declaration Part– declares all the variables used in the executable part.
There should be at least one statement in the executable part which contains instructions to perform certain task.
The declaration and executable part must appear between the opening and closing braces. All statements in the declaration part should end with the semicolon.

The Subprogram Section contains all the user defined functions that are called in the main function.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s