Structure of A C Program
Structure of A C Program
Structure of A C Program
Documentation Section
Link Section
Definition Section
}
Function1
Subprogram Section
Function2
. .
.
(User-defined Functions)
.
Function3
Every C program consists of one or more modules called functions. One of the
functions must be called main (). The program will always begin by executing the main
function, which may access other functions. A program consists of one or more functions.
It may also contain global variables. The “C” program is divided into 6 sections:
Documentation Section-
It consists of a set of comment lines giving the name of the program & other
details, which can be given by the user. The comment may appear anywhere within a
program, as long as they are placed within the delimiters.
#include<stdio.h>
Definition Section-
This section defines all the symbolic constants that user can define in macro
submission.
Sub-program Section-
The sub-program section contains all the user-defined function that is called in the
main () function. The user-defined function generally called sub-routines. This function
generally placed immediately after the main function.