Question: Write a C program that asks the user which mathematical operation they would like to perform (add, subtract, multiply, or divide) then ask them for
Write a C program that asks the user which mathematical operation they would like to perform (add, subtract, multiply, or divide) then ask them for two float numbers. Your program must use a switch statement and contain separate functions to perform the following mathematical calculations: addition, subtraction, multiplication, and division. Each function must accept the two numbers as parameters, perform the appropriate calculation on the two numbers and return the result back to the main () function. The main () function will then display the answer. You must use all local variables. Global variables will not be accepted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
