Question: Using a switch statement to create a program that performs the following operations(Using the program language C please) Use a switch statement to create a

Using a switch statement to create a program that performs the following operations(Using the program language C please)

Use a switch statement to create a program that performs the following operations:

If the user enters a or A, prompt the user for an integer value, and calculate and display its absolute value.

If the user enters m or M, prompt the user for two integer values, and determine and display the maximum of the two values.

If the user enters n or N, prompt the user for two integer values, and determine and display the minimum of the two values.

If the user enters s or S, prompt the user for two integer values, and determine and display the sum of the two values.

If the user enters d or D, prompt the user for two integer values, and determine and display the difference of the two values.

If the user enters q or Q, prompt the user for an integer value, and calculate and display the square of the value.

Choose an appropriate message for your default condition.

The program must:

Display a menu when it starts listing the options available.

Allow the user to enter their choice in either uppercase or lowercase

Using a switch statement to create a program that performs the following

allows the user to do something if the value was 10 or 9. To use case with characters use single quotes, e.g. case a

Only prompt the user to enter the integer value(s) after they have selected the operation choice i.e. within the cases.

Use an appropriate format for displaying the result e.g. The sum of 5 and 7 is 12

case 10: case 9: //C statements here break

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!