#include
using namespace std;
int main() {
char ch;
long long n1,n2;
do
{
cin>>ch;
int b=0;
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;
cout<<n1/n2<<endl;
break;
}
case ‘%’:
{
cin>>n1>>n2;
cout<<n1%n2<<endl;
break;
}
case ‘X’:
case ‘x’:
{
b=1;
break;
}
default:
cout<<“invalid operation.try again.”<<endl;
}
if(b==1)
{
break;
}
}while(true);
return 0;
}
four test cases are showing fail.pls tell what is the mistake.
two testcases are showing pass