Smile

Sunday, May 29, 2011

Structure of C program


Document Section

This section is used to write comment lines for describing program or part of the program. This section will not be executed. This is an optional section.
Example
//Program for finding prime numbers from 1 to 100
/*Program for finding number is even or odd*/

Pre-Processor Section or Link Section

This section is used to include predefined or user-defined header files to the present program.
Example
#include<stdio.h>

Global Declaration Section
This section is used to declare the global data (which can be used through out the program). This is also an optional section.

Main programming section
This section is the heart of C program. With out this section the program will not run.

SubProgramming Section
This section is used to represent the user defined functions which will be explained later.

No comments:

Post a Comment