Program:-
#include <stdio.h>
void main()
{
int a, b, add, sub, mul;
float divi;
printf("Enter two integers\n");
scanf("%d%d", &a, &b);
add = a + b;
sub = a - b;
mul = a * b;
divi = a / (float)b;
printf("Addition = %d\n", add);
printf("subtraction = %d\n", sub);
printf("Multiplication = %d\n", mul);
printf("Division = %.2f\n", divi);
}
Output:-
#include <stdio.h>
void main()
{
int a, b, add, sub, mul;
float divi;
printf("Enter two integers\n");
scanf("%d%d", &a, &b);
add = a + b;
sub = a - b;
mul = a * b;
divi = a / (float)b;
printf("Addition = %d\n", add);
printf("subtraction = %d\n", sub);
printf("Multiplication = %d\n", mul);
printf("Division = %.2f\n", divi);
}
Output:-
No comments:
Post a Comment