Skip to content

Commit

Permalink
Merge pull request #24 from vickeymadhukar/main
Browse files Browse the repository at this point in the history
calculator
  • Loading branch information
RoSPinoT authored Nov 19, 2022
2 parents 988d500 + 3877ee0 commit 7277b8e
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions basiccalc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include <iostream>
using namespace std;
int main(){
char op;
int number1,number2;
cout<<" enter the first number: "<<endl;
cin>>number1;
cout<<" enter the oprator "<<endl;
cin>>op;
cout<<" enter the second number: "<<endl;
cin>>number2;
cout<<"result: "<<endl;
switch(op)
{
case '+' :
cout<<number1+number2;
break;
case '-' :
cout<<number1-number2;
break;
case '*' :
cout<<number1*number2;
break;
case '/' :
cout<<number1/number2;
break;

default:
cout<<"select oprator form following + / - * ";
break;
}

















return 0;}

0 comments on commit 7277b8e

Please sign in to comment.