2. ASSUMING THAT PROGRAM IS CORRECT
Problem:
Write a program that will calculate the
sum, difference, quotient and product of
two integers. The program will have to
choose for the criteria.
A ------ Addition
S------- Subtraction
M------ Multiplication
D------- Division
3. SAMPLE OUTPUT
Enter 1st Number: 6
Enter 2nd number: 2
Enter Operation: M
The product of 6 and 2 is: 12
5. TRUE OR FALSE
6. Int num2;
7. int sum,diff,quo,prod:
8. printf(“Enter 1st number:”);
9. scanf(“%f”,&num1);
10. printf(“Enter 2nd number:”),
6. TRUE OR FALSE
11. scanf(“%d”,&sum2);
12. if (opt == ‘M’ || opt == ‘m’)
13. printf(“The product of %f and
%f is: %d”,num1,num2,sum);
14. If (Opt == ‘A’ || opt == ‘a’)
7. TRUE OR FALSE
15. printf(“The sum of %d and %d
is: %d”,num1,num2,sum);
16. if (opt == ‘D’ || opt == “d”)
17. printf(“The quotient of %f and
%f is: %d”,num1,num2,div);
8. TRUE OR FALSE
18. if (opt == ‘S’ || opt == ‘s’)
19. printf(“The difference of %d and
%d is: %d”,num1,num2,diff);
20. ]