saving . . . saved Doubt in the program has been deleted. Doubt in the program has been hidden .
Doubt in the program
I have two doubts in the program.
1.Is there any reason to write the int main() function after a few lines in this particular program, but to write the same immediately after the include <stdio.h> line in most other programs?
2. Why is there a semicolon after the curly bracket before int main() function?

C-and-Cpp Working-With-Structures 01-02 min 50-60 sec 21-10-20, 6:48 p.m.


You can start int main just after the header files (#include<stdio.h>). However, this is a good practice to have some space between the header files and the main program. 

The semicolon is used to denote the end of the structure. Like int, float, char, etc., the structure is also a data type. For declaring an int, we write something like int i = 10; 

Similarly, we need to add a semicolon with structure data types as well. 
22-10-20, 3:24 a.m. sudhakarst

Log-in to answer to this question.