Question: Write a menu - driven program for a simple calculator. The menu should have the following options: Addition, Subtraction, Multiplication, Division, and Quit. Use a

Write a menu-driven program for a simple calculator. The menu should have the following
options: "Addition," "Subtraction," "Multiplication," "Division," and "Quit." Use a while loop to
repeatedly display the menu and perform the selected operation until the user chooses to quit.
Sample Input and Output:
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Quit
Output should be like:
Choose your operation: 3
Enter the first integer: 3
Enter the second integer: 6
Result: 18
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Quit
Choose your operation: 5
GoodBye!
Optional question: Just for your own practice.
6. Write a program that takes an integer input from the user and prints all numbers from 1 to n
that are divisible by 5.
Sample Input:
Enter an integer: 50
Output:
5101520253035404550

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 Programming Questions!