MEHRAJ
MEHRAJ
OF C
PROGRAMMING
Basic Structure of C program
• DOCUMENTATION SECTION
• LINK SECTION
• DEFINATION SECTION
• GLOBAL DECRATION SECTION
CONT…
• Main() function section
• {
Declaration part
Executable part
• }
Cont…
• link section : It gives instructions to compiler to link the
built in functions from system library.
Ex: #include<stdio.h>
#include<conio.h>
Definition Section – It defines all the symbolic constants
Ex: define PI 3.14
Cont…
• Global Declaration section- Variables that are used in
more than one functions are declared in this section.
Ex:
int a= 10; // Global Variable
int add(){ int sub(){
printf(“%d”,a); printf(“%d”,a)
} }
Cont…
• main() Function Section – Every program must have a main function.
• It consist of two sections,
1) Declaration part
2) Executable part
Declaration part – Declaration all the needed variables for a program.
Executable part – At least one statement should be in the executable
part.
• Program execution begins the opening brace({) and ends at the
closing brace(}).