Basic calculator program

#include
using namespace std;

int main() {
char ch;
ch=cin.get();
while(ch!=β€˜X’ and ch!=β€˜x’){
int a,b;
cin>>a>>b;
switch(ch){
case β€˜+’:cout<<(a+b)<<endl;
break;
case β€˜-’:cout<<(a-b)<<endl;
break;
case '’:cout<<(ab)<<endl;
break;
case β€˜/’:cout<<(a/b)<<endl;
break;
case β€˜%’:cout<<(a%b)<<endl;
break;
default:cout<<β€œInvalid operation. Try again.”<<endl;
break;
}
ch=cin.get();
}
return 0;
}

when i run this code for sample input in sublime editor it runs infinite time.please tell me what is the error in this code.

hello @asif_h
pls share ur code using cb ide

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.