Program to show use of arithmetic operator (Addition,Multiplication,subtraction,division)
#include
#include
void main()
{
int a,b,result;
printf("\n Enter two numbers : - ");
scanf("%d %d",&a,&b);
result=a+b;
printf("\n Addition of %d and %d is %d ",a,b,result);
result=a-b;
printf("\n Substraction of %d and %d is %d ", a,b,result);
result=a*b;
printf("\n Multiplication of %d and %d is %d ",a,b,result);
result=a/b;
printf("\n Division of %d and %d is %d ",a,b,result);
getch();
}
Output :
No comments:
Post a Comment