Question: Details: You need to write a C program that when run, will clear the screen and asks the user to write the simple equation they
Details: You need to write a C program that when run, will clear the screen and asks the user to write the simple equation they want to evaluate. If the user enters a valid equation, it then displays the result. If user input is not valid, it displays an error message and asks for the correct equation. After the result is shown, it asks the user to enter another equation or press enter without any character to exit the program. The program continues infinitely until the user hits enter without entering anything else. For simplicity, your program accepts only +, -, * and / as operator. Only one operator is allowed per equation operating on two valid number operands.
Sample Run of the program:
Welcome to s Advanced Calculator,
please enter a valid equation followed by enter : 12 + 12.00 (enter)
12.00 + 12.00 = 24.00
Please enter a valid equation and press enter or press enter to exit. $5 * 9.0 (enter)
Not a valid equation.
Please enter a valid equation and press enter or press enter to exit. 2*1 (enter)
2.00 * 1.00 = 2.00
Please enter a valid equation and press enter or press enter to exit. 5 * 9.0 + 3 (enter)
Not a valid equation.
Please enter a valid equation and press enter or press enter to exit. (enter)
Thank you for using s Advance Calculator, good bye!
Press enter to exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
