The structure of C programming language is :-
- Documentation Section
- Links Section(File)
- Definition Section
- Global Variable Declaration Section
The structure follows the syntax below:-
Characterstics of Structure:-
- Documentation section consists of the comment lines which include name of program, author name, creation date, and other information.
- Links Section is used to link the required system libraries or header file to a program.
- Definition section is used to define or set values to variables.
- Global variable declaration section is used to declare global or public variable.
- Void main() is used to start the C program. It includes two parts as declaration part and executable part.
- Variable Declaration section is used to declare private variable
- Function declaration section used to declare functions of programs from which we get required output, and then executable statements are placed for execution.
- Function definition section is used to define the functions which are to be called from main().
Process of compilation and execution:-
- Creating Program: – An editor like notepad or word is used to create a C program. This file contains the source code which consists of executable code and then the file is saved as ‘.C’ extension.
- Compiling Program: – The next step is to compile the program. The code is then compiled in a compiler. The compiler converts the code in the binary code.
- Linking a library to a program: – The code of the program is then linked with libraries that are needed for execution of a program. The linker is used to link the program with libraries. It creates a file with ‘.exe’ extension in windows and ‘a.out’ file in LINUX.
- Execution of Program: – The final executable file is then run by DOS command prompt or by any other software.
The link to other chapters is given below:-