Question: Write a C + program to generate a short menu that asks the user to select a . Add, b . Multiply, or q .

Write a C+ program to generate a short menu that asks the user to select a. Add, b. Multiply,
or q. Quit. If add or multiply is selected, then input two integers and output their sum or
product. The menu should then repeat. If quit is selected, the program should exit.
Here is a sample execution, with user input in blue bold:
Select from the menu.
a. Add
b. Multiply
q. Quit
a
Enter two integers to add, separated by whitespace.
23
The sum is 5
Select from the menu.
a. Add
b. Multiply
q. Quit
b
Enter two integers to multiply, separated by whitespace.
-10
20
The product is -200
Select from the menu.
a. Add
b. Multiply
q. Quit
a
Enter two integers to add, separated by whitespace.
100200
The sum is 300
Select from the menu.
a. Add
b. Multiply
q. Quit
q

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!