Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This Program is in the C language, not the C++ language. Write a program that takes two integers a and b and prints their addition,
This Program is in the C language, not the C++ language.
Write a program that takes two integers a and b and prints their addition, subtraction, multiplication, division and modulo. If the value of b is zero, the program should not do the division or modulo because this will crash the program. Instead, the program does all the other operations and show an error message for the division and modulo, as in the second sample below. Below are two sample outputs. Your output should match all the format below. Enter integer a:7 Enter integer b:3 a + b = 7+3 = 10 a-b = 7-3 = 4 a* b = 7*3 = 21 a/b = 7/3= 2 a % b = 7 % 3 = 1 Enter integer a:6 Enter integer b:0 a + b = 6+0 = 6 a-b = 6-0 = 6 a* b = 6* 0 = 0 a/b = Cannot divide by zero a% b = Cannot divide by zeroStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started