Write a c program to find the all arithmetic operations.
Answers
Answered by
2
Attachments:
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:
Similar questions