Page 6 - PROGRAMMING IN C_Neat
P. 6
Flow Chart:
Start
Input a,b,c
False True
if (a > b)?
False True False if (a > c)? True
if (b > c)?
Output c Output b Output c Output a
End
_______________________________________________________________________________________
6. Explain the structure of a C program with an example. *
Structure of a C Program:
General Structure of a C Program:
Include Section
Global Declaration Section
main()
{
Local Declaration Section
Statement Section
}
User-defined Function Section
Include Section:
In this section, header files are included.
Global Declaration Section:
In this section, global variables are declared.
main() Section:
Execution of the program starts from the main() function.
Local Declaration Section:
In this section, local variables used in main() function are declared.
Statement Section:
In this section, the C statements required to solve the program are written.
User-defined Function Section:
In this section, user-defined functions are written.