Question: Homework_1: (The Challenge switch + while): Write a C program to display a menu and ask the user to choose one option from the menu.


Homework_1: (The Challenge switch + while): Write a C program to display a menu and ask the user to choose one option from the menu. This program should ask the user to input two numbers and depending on his choice elther add, subtract, multiply or divide these two number. The program must go back to the menu after it execute one of the choices until the user decide to exit the program by choosing the exit option in the menu. Moreover, if a user input a wrong option, the program must display message that ask the user to choose only a valid option form [1-6] and display the menu again. Example: Input Please input your first number: Please input your second number: Menu Please choice one of the following options 1. To add the numbers 2. To multiply the numbers 3. To subtract the first-second 4. To divide the first second 5. Exit the program Your choice is: Output You have chosen to __, therefore the result is: Press any key to go back to the main menu In case a user choice wrong option, e.g. 7, the output should be: Your Choice is invalid, please choose option form (1-5) Hint: you will need to use the function gets() in this program to make the program walt the user to press any key. The code below is designed to help youl press any key. The code below is designed to help youl #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
