1.

Explain the Basic Structure of C program in detail.

Answer»

Basically structure of the C program is divided into six different sections,

1. Documentation section: The Documentation section consists of a set of comment lines.

2. Link section: The link section provides instruction to the compiler to link the header files or functions from the system library.

3. Definition section: The definition section defines all symbolic constants such by using the #define directive.

4. Global declaration section: There are some variables that are used in more than one function, such variables are called global variables.

In C there are two types of variable declaration,

Local variable declaration: Variables that are declared inside the main function.

Global variable declaration: Variables that are declared outside the main function.

5. Main function section: Every C-program should have one main() function.
This section contains two parts:

Declaration part

Executable part

6. Sub-program section: If the program is a multi-function program, then the subprogram section contains all user-defined functions that are called in the main() function.



Discussion

No Comment Found

Related InterviewSolutions