Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

#include <stdio.

h>
#include <conio.h>
int main() {
int a, b, c, d, e, f, sum, diff, prod;
float div;
printf("Enter the variable a: ");
scanf("%d", &a);
printf("Enter the variable b: ");
scanf("%d", &b);
printf("Enter the variable c: ");
scanf("%d", &c);
printf("Enter the variable d: ");
scanf("%d", &d);
printf("Enter the variable e: ");
scanf("%d", &e);
printf("Enter the variable f: ");
scanf("%d", &f);
sum = a + b;
diff = c - d;
prod = e * f;
div = (float)e / f;
printf("The sum of %d and %d is %d\n", a, b, sum);
printf("The difference of %d and %d is %d\n", c, d, diff);
printf("The product of %d and %d is %d\n", e, f, prod);
printf("The division of %d by %d is %.2f\n", e, f, div);
getch();
return 0;
}

You might also like