My code is failing for some of test cases

#include
using namespace std;
int main() {
char ch;
do
{
cin>>ch;
if(ch==‘x’||ch==‘X’)
break;
int n,m;
switch(ch)
{
case ‘+’: cin>>n>>m;cout<<n+m<<endl;break;
case ‘-’: cin>>n>>m;cout<<n-m<<endl;break;
case '’: cin>>n>>m;cout<<nm<<endl;break;
case ‘/’: cin>>n>>m;cout<<n/m<<endl;break;
case ‘%’: cin>>n>>m;cout<<n%m<<endl;break;
default: cout<<“Invalid operation.Try again”<<endl;break;

}
}
while(1);
return 0;

}

Hi @namangarg31, there is a very small mistake . in the default case you are printing wrong statement
there is a space between . and Try also Try again ends with a full stop
your code :

default: cout<<“Invalid operation.Try again”<<endl;break;

corect code

default: cout<<“Invalid operation. Try again.”<<endl;break;

refer this : -

in case of any doubt feel free to ask :slight_smile:
If you got the answer then mark your doubt as resolved