Write a c program to find the all arithmetic operations.
Answers
Answered by
2
Attachments:
![](https://hi-static.z-dn.net/files/de2/fc4e2d09acb0d2446eb328438cd12809.jpg)
![](https://hi-static.z-dn.net/files/d1e/7901e28a22139ede0734fddb00d9b7cd.jpg)
Answered by
5
C Program to find the all arithmetic operations.
#include<stdio.h>
int main(){
int num1, num2, add, subtract, multiply;
float divide;
printf("Enter two numbers\n");
scanf("%d%d", &num1, &num2);
add = num1 + num2;
subtract = num1 - num2;
multiply = num1 * num2;
divide = num1 / (float)num2;
printf("Sum = %d \n", add);
printf("Difference = %d \n", subtract);
printf("Multiplication = %d \n", multiply);
printf("Division = %.2f \n", divide);
return 0;
}
EXAMPLE OUTPUT
Enter two numbers
Sum = 7
Difference = 3
Multiplication = 10
Division = 2.50
*Program has been run in the above attachmnet with output attached*
Attachments:
![](https://hi-static.z-dn.net/files/d92/655972375603b26706a4ab8d140504a5.png)
![](https://hi-static.z-dn.net/files/dc4/e7ac9c1f738a34d043266cf2bef02c04.png)
Similar questions