// C program to add,subtract,multiply and divide.
#include<stdio.h>
int main()
{
int a,b;
printf("Enter two numbers:");
scanf("%d",&a);
scanf("%d",&b);
printf("Addition=%d",a+b);
printf("\nSubtraction=%d",a-b);
printf("\nMultiplication=%d",a*b);
printf("\nDivision=%d",a/b);
return 0;
}
Sample Input/Output:
Enter two numbers:20
20
Addition=40
Subtraction=0
Multiplication=400
Division=1
#include<stdio.h>
int main()
{
int a,b;
printf("Enter two numbers:");
scanf("%d",&a);
scanf("%d",&b);
printf("Addition=%d",a+b);
printf("\nSubtraction=%d",a-b);
printf("\nMultiplication=%d",a*b);
printf("\nDivision=%d",a/b);
return 0;
}
Sample Input/Output:
Enter two numbers:20
20
Addition=40
Subtraction=0
Multiplication=400
Division=1
No comments:
Post a Comment