Saturday, 10 December 2011

Write a program to addition,subtraction,multiplication,divition in c

#include
#include
main()
{
int a,b,add,sub,mult,div;
clrscr();
printf("ENTER NO.A:-");
scanf("%d",&a);
printf("ENTER NO.B:-");
scanf("%d",&b);
add=a+b;
sub=a-b;
mult=a*b;
div=a/b;
printf("Add=%d\nSub=%d\nMult=%d\nDiv=%d",add,sub,mult,div);
getch();
}


OUTPUT
ENTER NO A:20
ENTER NO B:5
ADD=25
SUB=15
MULT=100
DIV=4

No comments:

Post a Comment