The document outlines the typical sections of a C program, including:
1) Documentation section for program details
2) Link section to include libraries
3) Definition section for constants
4) Global declaration section for global variables and functions
5) Main function section containing declarations and executable code
6) Subprogram section for additional user-defined functions
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
137 views3 pages
Documentation Section
The document outlines the typical sections of a C program, including:
1) Documentation section for program details
2) Link section to include libraries
3) Definition section for constants
4) Global declaration section for global variables and functions
5) Main function section containing declarations and executable code
6) Subprogram section for additional user-defined functions
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
1.
Documentation section:
The documentation section consists of a set of
comment lines giving the name of the program, the author and other details, which the programmer would like to use later. These information give the program an identity and basic authority.
2. Link section: The link section provides
instruction to the compiler to link or include the required in-built functions from the system library such as using the #include directive. This is important, because if we need to use any in-built system function we must first include the library in which the function has been defined.
3. Definition section: The definition section
defines all symbolic constants using the #define directive. Having the constants being defined here, we can use them elsewhere in code.
4. Global declaration section: There are some
variables that are used in more than one function; these variables are called global variables and are declared in this global declaration section which is outside the definition of any function This section also declares all the user-defined functions. As this global scope, these functions and variables can be used from definition of other functions.
5. main () function section: A C program must
have one main function section in its structure. This section contains two parts; declaration part and executable part. However, the content of these two parts can be mixed. 1. Declaration part: The declaration part declares all the variables used in the executable part.
2. Executable part: There is at least one
statement in the executable part. These two parts must appear between the opening and closing braces of the main function. The program execution begins at the opening brace and ends at the closing brace. The closing brace of the main function is the logical end of the program. All statements in the declaration and executable part end with a semicolon.
6. Subprogram section: If the program is
a multi-function program then the subprogram section contains definition of all the user- defined functions which were declared earlier in the Definition Section. User-defined functions are generally placed immediately after the main () function, although they may appear in any order.