Structure of a C Program

Documentation Section
Pre-proccessor Directives
Definition Section
Global Declaration Section
main()
{
Decleration Part
Executable Statements
}

The above structure is the structure of C programming langueage.
Please don't  get confused, it is too easy, i will explain the stucture of C now, but even if you don't understand at first time, this is too normal, because when you start programming something in C, you will understand the structure and you will learn C perfectly, just keep reading my next posts to understand it better.

  • Documentation Section : It consists of comments, name of program and brief explanation of the program etc. (Documentation section is not something essential, it is just an explanation for the programmer to understand the program after long time that he/she made).
  • Pre-processor Diretives : It is also known as link section. Pre-proccessor directives provides instructions to the compiler to link function.
  • Defination Section : It defines all symbolic constants.
  • Gloabal Declaration Section : Variables used in more than function are declared in global declaration section.
  • main() : A C program must have one main() function and it consist of 2 parts. This parts are enclosed between opening and closing curly brackets and they are Declaration Part and Executable Statements.
  • Declaration Part : It declares all variables used in main() function.
  • Executable Statements : There is atleast one executable statement in this part.