-
-
Save amankharwal/375374688587701f6f975b53ed5ada1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
int a, b, output; | |
char input; | |
cout<<"Enter Value 1 and Value 2 : "; | |
cin>>a>>b; | |
cout<<"Enter The Arithmetic Operation You Want (+, -, /, x) : "; | |
cin>>input; | |
switch(input){ | |
case '+': output = a + b; | |
break; | |
case '-': output = a - b; | |
break; | |
case '/': output = a / b; | |
break; | |
case 'x': output = a * b; | |
break; | |
default: cout<<"Invalid Operation"; | |
} | |
cout<<output; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment