Write a menu-driven program using the Switch case to calculate the following:
- Addition of two numbers
- Difference between two numbers
- Product of two numbers
- Division of two numbers
- HCF of two numbers
- LCM of two numbers
Input: num1 = 5, num2 = 7, choice = 1 Output: Sum is 12 Input: num1 = 5, num2 = 7, choice = 5 Output: GCD is 1
Press 1 to calculate Sum of Numbers Press 2 to calculate Difference of Numbers Press 3 to calculate Product of numbers Press 4 to calculate Division of numbers Press 5 to calculate HCF of numbers Press 6 to calculate LCM of numbers Press 7 to exit Enter your choice: Choice is 1 Sum is 12
Time Complexity: O(n).
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Menu Driven Program to convert MKS to CGS and CGS to MKS
- Menu-Driven program for Phone Directory
- Menu driven program for system control using C++
- Menu-Driven program using Switch-case in C
- Menu-Driven Program for Bank Management System
- C/C++ program to make a simple calculator
- Program for EMI Calculator
- Basic calculator program using Python
- Program to create grade calculator in Python
- Program to evaluate simple expressions
- Program to find simple interest
- Program to find simple moving average
- Simple Interest
- Number of Simple Graph with N Vertices and M Edges
- Kruskal's Algorithm (Simple Implementation for Adjacency Matrix)
- Prim's Algorithm (Simple Implementation for Adjacency Matrix Representation)
- Find if a degree sequence can form a simple graph | Havel-Hakimi Algorithm
- Times required by Simple interest for the Principal to become Y times itself
- C++ Program for QuickSort
- C++ Program for ShellSort
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.