c 2b 2b calculator program using switch case

Solutions on MaxInterview for c 2b 2b calculator program using switch case by the best coders in the world

showing results for - "c 2b 2b calculator program using switch case"
Luis
02 Nov 2018
1#include<iostream>
2using namespace std;
3int calculator(int num1,int num2,int num3);
4int main()
5{
6    //int num1,num2,num3,choice;
7    int a,b,c,choice;
8    cout<<"enter the first number"<<endl;
9    cin>>a;
10    cout<<"enter the second number"<<endl;
11    cin>>b;
12    cout<<"************************"<<endl;
13    cout<<"****Make your choice****"<<endl;
14    cout<<"1.Addition"<<endl;
15    cout<<"2.Subtraction"<<endl;
16    cout<<"3.Multiplication"<<endl;
17    cout<<"4.Division"<<endl;
18    cout<<"************************"<<endl;
19
20    choice=calculator(a,b,c);
21    return 0;
22}
23int calculator(int num1,int num2,int num3)
24{
25
26    int choice;
27    cin>>choice;
28    switch(choice)
29    {
30
31        case 1: cout<<"you have selected Addition"<<endl;
32                num3=num1+num2;
33                cout<<"Addition of two numbers is "<<num3<<endl;
34                break;
35
36        case 2: cout<<"you have selected Subtraction"<<endl;
37                num3=num1-num2;
38                cout<<"Subtraction of two numbers is "<<num3<<endl;
39                break;
40
41        case 3: cout<<"you have selected Multiplication"<<endl;
42                num3=num1*num2;
43                cout<<"Multiplication of two numbers is "<<num3<<endl;
44                break;
45
46        case 4: cout<<"You have selected Division"<<endl;
47                num3=num1/num2;
48                cout<<"Division of two numbers is "<<num3<<endl;
49                break;
50
51        default: cout<<"You have entered wrong choice"<<endl;
52                    break;
53    }
54}
55
56
queries leading to this page
make calculator in c 2b 2bcpp code for calculatorhow to make calculator in c 2b 2b using switchwrite a program to make simple calculator using switch case in c 2b 2bc 2b 2b program to make a simple calculatorc 2b 2b calculatorhow to make a c 2b 2b calculator with all operationscalculator c 2b 2bsimple calculator program in c 2b 2bhow to make a calculator in c 2b 2bcalculation in c 2b 2bsource code for calculator in c 2b 2bc 2b 2b program to make a simple calculator using functionscalculator program in cppcalculator c 2b 2b programmhow to implement calculator c 2b 2bwrite a program that mimics a calculator c 2b 2bcalculator in c 2b 2bhow to add a number string to a number in cpp in simple calculatorcalculator in cppcalculator program in c 2b 2b using functions and switch casec 2b 2b calculator using switch casecalculator program in c 2b 2b using switch casec 2b 2b calculator programcalculator using switch c 2b 2bsimple basic calculator c 2b 2bsimple calculator c 2b 2bsimple calculater code c 2b 2bbasic calculator c 2b 2bswitch case calculator in c 2b 2bc 2b 2b program to make calculator using switch casec 2b 2b 25 calculationmaking a calculator in c 2b 2bcalculator using switch case c 2b 2bhow to create calculator in c 2b 2bc 2b 2b calculator how to implement divisionhow to make calculator using c 2b 2bc 2b 2b calculator double divisionswitch case calculator in cppscientific calculator program in c 2b 2b using switch casec 2b 2b program calculatormaking a calculator with switch in c 2b 2bcalculator using in cppcalculator c 2b 2bc 2b 2b simple calculator using switch casewrite a program to make a calculator using switch case in c 2b 2bturbo c 2b 2b calculator source codec plus plus cal testsimple calculator c 2b 2b void mainsyntax of switch statement c 2b 2b calculatorc 2b 2b calculator using functions void mainwrite a c 2b 2b program that performs calculator operations and throws exception if an attempt is made to divide a number by zero or if an invalid operator is applied 2810marks 29 operations allowed 2b 2c 2c 2a 2c 2fcreating a calculator in c 2b 2bhow to write a calculate in c 2b 2bmake calculator in c 2b 2b to find add 2csub and powercalculator using switch case in cppcalculator using switch and class c 2b 2bc 2b 2b calculator projecthow to build a calculator in c 2b 2bc 2b 2b calculator program without using switch casecalc c 2b 2bwrite a simple calculator program that calculates the difference 2c sum or product of two numbers simple calculator program in c 2b 2b using switch casehow to write a simple calculator program using switch case c 2b 2bc language program for simple calculator enter 1 for addition enter 2 for subtractioncalculator program in c 2b 2bc 2b 2b program to make a simple calculator using switch casec 2b 2b calculator with fuctionsmake calculator using switch operation easy c 2b 2bc 2b 2b switch case calculatorbasic cpp calculatorsyntax of switch statement c 2b 2b calculator functioncalculator in c 2b 2b using switchc 2b 2b calculator program using switch casedesign calculator c 2b 2bhow to use switch case in c 2b 2b programming for calculatorc 2b 2b calculator functionc 2b 2b calculator codeoutput calculator c 2b 2bthe program of simple calculator by switch c 2b 2bcalculator using only 2b 2bcalculator program using switch case in cpp2 digitcalculater cpp progrrammake calculator using switch operation easy oop c 2b 2bcalcuator program using siwtch case c 2b 2bcalculator using switch case in c 2b 2b gfgcode for a calculator in c 2b 2bc 2b 2b basic arthimatic calculatorcalculator c using the switch statement in c 2b 2b to make calculatorc 2b 2b how to make a calculatorcalculator using switch case in c 2b 2bcomplete this simple calculator program using functions c 2b 2bswitch case with c 2b 2b 2c when using calculatorwrite a program to make simple calculator using if else in c 2b 2bhow to write a simple calculator program in cppsimple calculator codezen c 2b 2bcalculator in cpp using switchc 2b 2b calculator program using switch case