Hi guys, we will discuss the Basic Structure of a C program in this section. This section is very important to clear your concepts about programming and you will learn how to write codes in C from scratch. So without wasting time let's get started.
Basic Structure Of a C Program:
First of all, let's try to understand the picture. Here all the lines are marked with arrow marks.
Let's understand all the components of the C Program which is given above.
* # include:
This is a pre-processor command and this statement tells the compiler that to include the information contained in the file <stdio.h> (Standard Input And Output Operations).
* Comments:
It is used to add some information or comments on our programs. They are ignored by the compiler and just parse it.
* Single-line comment ( //......)
* Multi-line comment ( /*......*/ )
* Semicolon:
Semicolon is known as an instruction terminator. Each expression statement ended with a semicolon (;)
* Braces:
Mostly braces '{ }' are used to write a program. This is used to enclose a pair/set of statements.
* Main() Function:
The main function is a special function in the C program. Execution of the program starts from here.
That's all for this section. We discuss all the programming structures in our overall course. You can also watch videos on YouTube for more information about this concept.