In this post, we are going to make a program in c to accept two numbers from the user and perform various arithmetic operations using the switch function.
Algorithm:-
1. We write Header File & Math File
2. Declare a,b, and choice as Integer.
3. Declare c,d as Float.
4. We use a whole loop with the condition.,
5. Write the menu.
6. Take input in choice.
7. Write all cases if the user type 1 then Add two numbers
8 Print the Output
Code
#include <stdio.h>
#include <math.h>
Output
Calculator
1.Addition
2.Subtraction
3.Multiplication
4.Division
5.Modulus Division
6.Break
----------------------------------------------------------------------------------------
Enter your choice3
Enter two numbers99
10
Multiplication of two numbers is 990
Calculator
1.Addition
2.Subtraction
3.Multiplication
4.Division
5.Modulus Division
6.Break
----------------------------------------------------------------------------------------
Enter your choice