Question
in C language, Create a calculator program that accepts selection input followed by two integer inputs repeatedly until q is selected. The selection input can
in C language, Create a calculator program that accepts selection input followed by two integer inputs repeatedly until q is selected. The selection input can be either m,a,s or q. Based on the selected operator, the appropriate mathematical operation should be performed and the result is displayed as shown below. The program displays the message End of program before it terminates m multiply a - average s - sum
Sample input and output run
Enter (m a s or q to quit): m
Enter first number : 4 E
nter second number : 3 4 * 3 = 12
Enter (m a s or q to quit): s
Enter first number : 5
Enter second number : 6 5 + 6 = 11
Enter (m a s or q to quit): d
Enter first number : 7
Enter second number : 3 7 - 3 = 4
Enter (m a s or q to quit): q
End of program Assume all inputs are valid; no need to validate any input.
Step 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