My issue
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int a,b;
char c;
cin>>a;
cin>>b;
cin>>c;
switch(c){
case ‘+’:
cout<<a+b;
break;
case ‘-’:
cout<< a-b;
break;
case '':
cout<<ab;
break;
case '/':
cout<<a/b;
break;
}
}
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int a,b;
char c;
cin>>a;
cin>>b;
cin>>c;
switch(c){
case '+':
cout<<a+b;
break;
case '-':
cout<< a-b;
break;
case '*':
cout<<a*b;
break;
case '/':
cout<<a/b;
break;
}
}
Problem Link: Program Your Own CALCULATOR Practice Coding Problem - CodeChef