Saturday

Basic Structure of c program

Basic Structure of C program

Documentation Section: - It includes a comment statement that gives detail information about program.

Linking Section: - It provide introduction to compiler about linked functions and included library files (header files).

Definition Section: - Define all symbolic constant.

Global Declaration Section: - Variables that are declared globally which are available in all function in program.

Main () function Section: - Every c program has only one main function in which program code is written and it content two parts.

Note: By default return type of main function is “int”.

Declaration Part: - All variables must be declared before it used or executable part.

Execution part: - Executable code should be written in this section. There should be at least one statement in this part which contains instructions to perform given task.

Note:

  • The declaration and executable part must be written in between the opening and closing braces.

  • All statements in the declaration part must end with the semicolon.

  • C is a case sensitive programming language. It means in C printf and Printf will have different meanings.

  • C has a free-form line structure.

  • Multiple statements can be one the same line.

  • White Spaces (ie tab space and space bar ) are ignored.

Sub program Section: - It contents all user define functions which are called in main function.

 

No comments:

Post a Comment