Test cases not passing

#include
using namespace std;
int main() {
int a;
int b;
int c;

char ch;

for(int i=0; ;i++)
{ cin>>ch;
if (ch==’+’|| ch==’-’ || ch==’/’ || ch==’%’|| ch==’*’)
{
cin >> a >> b ;
}
else if (ch==‘X’ || ch==‘x’)
{
return 0 ;
}

switch(ch){
case ‘+’:

         c=a+b;
         cout<<c<<endl;
         break;

case ‘-’:

         c=a-b;
         cout<<c<<endl;
         break;

case ‘*’:

         c=a*b;
         cout<<c<<endl;
         break;

case ‘/’:
if(b!=0)
{ c=a/b;
cout<<c<<endl;}
break;
case ‘%’ :
if(b!=0)
{ c=a%b;
cout<<c<<endl;}
break;
default:
cout<<“Invalid operation. Try again”<<endl;

}}

return 0;

}

Firstly, here it is highly recommended that you use do while loop instead of simple for loop, since there is no test expression you are checking in it. So make changes accordingly.

#include
using namespace std;
int main() {
char ch;
int n1,n2;
cin>>ch;
do{
switch(ch){
case '’ :
cin>>n1>>n2;
cout<<n1
n2<<"\n";
break;
case ‘/’ :
cin>>n1>>n2;
cout<<n1/n2<<"\n";
break;

    case '+' :
                    cin>>n1>>n2;
                    cout<<n1+n2<<"\n";
                    break;

    case '-' :
                    cin>>n1>>n2;
                    cout<<n1-n2<<"\n";
                    break;

    case '%' :
                    cin>>n1>>n2;
                    cout<<n1%n2<<"\n";
                    break;
    case 'x':        return 0;
    case'X' :        return 0;
    default:        cout<<"Invalid operation. Try again.\n";
    }
    cin>>ch;

}while(ch!=‘x’||ch!=‘X’);

return 0;
}

try this