explain the structure of c programing
Answers
Answered by
5
Basic Structure of a C Program:
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.
Link section : The link section provides instructions to the compiler to link functions from the system library.
Definition section : The definition section defines all symbolic constants.
Global declaration section : There are some variables that are used in more than one function. Such variables are called global variables and are declared in the global declaration section that is outside of all the functions. This section also declares all the user-defined functions.
main () function section : Every C program must have one main function section. This section contains two parts; declaration part and executable partDeclaration part : The declaration part declares all the variables used in the executable part.Executable part : There is at least one statement in the executable part. These two parts must appear between the opening and closing braces. 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.
Subprogram section : The subprogram section contains all the user-defined functions that are called in the main () function. User-defined functions are generally placed immediately after the main () function, although they may appear in any order. Note:All section, except the main () function section may be absent when they are not required
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.
Link section : The link section provides instructions to the compiler to link functions from the system library.
Definition section : The definition section defines all symbolic constants.
Global declaration section : There are some variables that are used in more than one function. Such variables are called global variables and are declared in the global declaration section that is outside of all the functions. This section also declares all the user-defined functions.
main () function section : Every C program must have one main function section. This section contains two parts; declaration part and executable partDeclaration part : The declaration part declares all the variables used in the executable part.Executable part : There is at least one statement in the executable part. These two parts must appear between the opening and closing braces. 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.
Subprogram section : The subprogram section contains all the user-defined functions that are called in the main () function. User-defined functions are generally placed immediately after the main () function, although they may appear in any order. Note:All section, except the main () function section may be absent when they are not required
Answered by
2
Structure of C programming :
1. Documentation Section --------- Optional
2. Link Section --------- Optional
3. Defining Section --------- Optional
4. Global Declaration Section -------- Optional
5. Main Function --------- Important
6. Sub Program Section --------- Optional
Hope this helps!
1. Documentation Section --------- Optional
2. Link Section --------- Optional
3. Defining Section --------- Optional
4. Global Declaration Section -------- Optional
5. Main Function --------- Important
6. Sub Program Section --------- Optional
Hope this helps!
Similar questions