Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created August 17, 2021 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/375374688587701f6f975b53ed5ada1a to your computer and use it in GitHub Desktop.
Save amankharwal/375374688587701f6f975b53ed5ada1a to your computer and use it in GitHub Desktop.
#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