Write a Program to perform addition, subtraction, multiplication and division of Two Numbers.
#include <stdio.h>
int main()
{
int first, second;
int addition, subtract, multiply;
float divide;
printf("Enter two integers\n");
scanf("%d%d", &first, &second);
addition = first + second;
subtract = first - second;
multiply = first * second;
divide = first / (float)second;
printf("Sum = %d\n", addition);
printf("Difference = %d\n", subtract);
printf("Multiplication = %d\n", multiply);
printf("Division = %.3f\n", divide);
return 0;
}
#include <stdio.h>
int main()
{
int first, second;
int addition, subtract, multiply;
float divide;
printf("Enter two integers\n");
scanf("%d%d", &first, &second);
addition = first + second;
subtract = first - second;
multiply = first * second;
divide = first / (float)second;
printf("Sum = %d\n", addition);
printf("Difference = %d\n", subtract);
printf("Multiplication = %d\n", multiply);
printf("Division = %.3f\n", divide);
return 0;
}
No comments:
Post a Comment