Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
image text in transcribed
image text in transcribed
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 #include

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

Discuss all branches of science

Answered: 1 week ago

Question

2. Compare the sales and service departments at Auto World.

Answered: 1 week ago