#include <stdio.h>
int main()
{
int x, y;
int sum, sub, mult, mod;
double div;
printf("Enter x : ");
scanf("%d", &x);
printf("Enter y : ");
scanf("%d", &y);
sum = x + y;
sub = x - y;
mult = x * y;
mod = x % y;
div = (double)x / y;
printf("Sum of x and y = %d \n", sum);
printf("Difference of x and y = %d \n", sub);
printf("Product of x and y = %d \n", mult);
printf("Modulus of x and y = %d \n", mod);
printf(" The Quotient of x and y = %lf ", div);
return 0;
}
Output:-
Enter x : 10
Enter y : 5
Sum of x and y = 15
Difference of x and y = 5
Product of x and y = 50
Modulus of x and y = 0
The quotient of x and y = 2.000000
0 Comments