Program Structure

1)Documentation Section---Include Comment

2)Link Section----Include headerFile

3)Definition Section---Include symbolic     

 4)Global Declaration---Include Global Variable

5)Main Section---Include main function

6){

7)Declaration part---Include variable declaration

8)Executable part---Include statement

9)}

 

FILES CREATED…...

.exe file -------- required computer to execute the program.
.obj file --------After compiling the program this file of the program is generated.

 

//program of arithmetic calculation…             Documentation Section

 

#include<stdio.h>                                //header file ….Link Section

main()                                                    //Main section

{

int firstno,secno,resultno;           //variable declaration

clrscr();       //clear the previous screen output

printf(“enter the value of firstno and secno”); /*print the message for inputting the  value(optional)*/

scanf(“%d%d”,&firstno,&secno); /*scanf is used input the value to the variables(& address operator)*/

resultno=firstno*secno;                 //calculation

printf(“c=%d”,resultno);               //print the output with message

getch();                                           //get thecharacter

}

Explaination

The main()Function-->  The main () consists of the name main followed by a pair of empty parantheses (()) & a pair of braces({}). Within the braces are statement that makes up the main body of the program.The program execution starts at the first statement in main() and terminates at the last statement in main().

The # include directive(Preprocessor)-->An include file is a separate disk file that contains information needed by your program or the compiler .Several of these files (sometime called header files) are supplied with your computer.

Variable declaration-->  A variable is a name assigned to a data storage location.

Program Statement--> C statement display information onscreen, read keyboard input, perform math operation etc.

Printf--> This statement is a library function that displays information on screen.

Scanf--> It reads data from the keyboard and assigns that data to one or more program variable.

Braces{}-->   A group of one or more statements enclosed within braces is called a block.