Question: write in C program You are to use Visual Studio to write a simple desktop calculator. The program will: Read a floating point number, Read

write in C program

You are to use Visual Studio to write a simple desktop calculator. The program will:

  • Read a floating point number,
  • Read an operator (+, -, *, /, %)
  • Read a second floating point number
  • Check for error conditions such as a missing or unknown operator, division by zero, modulus by zero or trying to do modulus on non-integral values
  • Print either an error message or the result of the calculation and then terminate
  • If the result of the calculation is an integer, it should be printed with no places after the decimal.

The user might leave zero or one spaces between the numbers and the operator. Your program will need to read the input carefully to handle these situations.

Your program should produce output similar to this (input shown in bold):

3+ 7 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!