Saturday, 21 March 2015

Basic Structure of a C Program

Basic structure of a C Program
                                                                        





   1.   The documentation section of the program contains a  set of comment lines that mention   the name of the program, the author ,date of compilation and other details that maybe useful later while maintenence.
            
  2.   The link section provides instructions to the compiler  to link functions with the system      library. Consists of  #include<filename>  directives.

  3.  The definition section is for defining constants.eg: define PI 3.14
        Statements in this section do not end with a semi colon.

 4.    All the global variables are declared in the global declaration section.

 5.    Every C program must have exactly one main() function.The main() function has two part  : declaration part which  consists of declaration of variables to be used in the program and executable part that contains the program statements. 

  6.   The Subprogram section contains all the user defined functions that are called from the main() function.

0 comments:

Post a Comment