#include
using namespace std;
int main() {
char ch;
int n1, n2;
while(cin>>ch) {
switch(ch) {
case ‘+’: cin>>n1>>n2; cout<<n1+n2<<endl; break;
case ‘-’: cin>>n1>>n2; cout<<n1-n2<<endl;break;
case '’: cin>>n1>>n2; cout<<n1n2<<endl;break;
case ‘/’: cin>>n1>>n2; if(n2!=0) {cout<<n1/n2<<endl; }
break;
case ‘%’: cin>>n1>>n2; if(n2!=0) {cout<<n1%n2<<endl; }
break;
case ‘X’: exit(0);
case ‘x’: exit(0);
default: cout<<“Invalid operation. Try again.”;
}
}
return 0;
}
Where is the code lacking? There are 3 test cases that says ‘wrong-answer’. PLease suggest changes.