Thursday, 8 May 2014

C Simple Addition Program

C ADDITION SIMPLE PROGRAM

1.#include
2.#include
3.main(){
4.int a,b,add;
5.clrscr();
6.printf("Enter the numbers for addition");
7.scanf("%d%d",&a&b);
8.add=a+b;
9.printf("the addition of two numbers %d",add);
10.getch();
11.}

PROGRAM EXPLANATION

Line 1 : Header file stdio.h standard input output 

Line 2 : Header file conio.h

Line 3 : main() function is use for compiler in where the program is to start {-denotes the start of the program

Line 4 : datatype integer represents int  a,b,add are the variables in this program

Line 5 : clrscr () function used for print the output in new screen

Line 6 : prints the statement Enter the number for additon

Line 7 : read numbers and stored in variables a,b

Line 8 : the expression a+b is stored in add variable

Line 9 : print the statement the addition of two numbers 

Line 10 : getch() function is used for hold the output screen

Line 11 : } represents the end of the program 

No comments:

Post a Comment