Вы находитесь на странице: 1из 2

DIAGRAM

Documentation Section

Link Section

Definition Section

Global Declaration Section


Declaration Part
main() FunctionPart
Executable 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.

/* -------- */ (For Multiple lines)


// ---------- (For Single lines)
Link Section-
This section provides instruction to the compiler to link the functions from the
system libraries.

#include<stdio.h>

Definition Section-
This section defines all the symbolic constants that user can define in macro
submission.

Global Declaration Section-


In this section the user can define the arguments for whole C program. There are
some variables that are used in one or more than one function; such variables are called
global variables.

Main Function Section-


Every C program must have one main () function. It contains two parts named as
declaration part and executable part. The declaration part declares the variables used in
the executable part. There is at least one statement in the executable part.

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.

Вам также может понравиться