Basic calculator.cpp

it is not working for testcase 1 2and 4

#include
#include<stdlib.h>
using namespace std;
int main() {
char ch;
int n1,n2;
cin>>ch;
if(ch==’+’|| ch==’-’||ch==’/’||ch==’’||ch==’%’)
{
cin>>n1>>n2;
switch(ch) {
case β€˜+’ :
cout << (n1+n2)<<endl;
break;
case '
’ :
cout << (n1*n2);

    break; 
case '-' : 
    cout << (n1-n2); 
    break; 
case '%' : 
    cout << (n1%n2); 
    break; 
case '/' : 
    cout << (n1/n2); 
    break; 
 
}
}

else if(ch==β€˜X’||ch==β€˜x’){
exit(0);
//return 0;
}
else
{
cout<<β€œInvalid operation. Try again.”<<endl;
main();
}
if(ch!=β€˜X’||ch!=β€˜x’)
return 0;
}

@ayush1213 hey ayush can you please share your code through cb.lk/ide so that I can help you asap