Basic Calculator

I cannot run this code. I have no clue why this is happening.
#include
using namespace std;
int main() {
int ch,N1,N2;
while(true){
cin>>ch;
if(ch ==’+’ || ch == ‘-’ || ch == ‘’ || ch == ‘/’ || ch == ‘%’){
cin>>N1>>N2;
if(ch == ‘+’){
cout<<(N1+N2);
}
else if(ch == ‘-’){
cout<<(N1-N2);
}
else if(ch == '
’){
cout<<(N1*N2);
}
else if(ch == ‘/’){
cout<<(N1/N2);
}
else{
cout<<(N1%N2);
}
}
else if(ch == ‘X’ || ch == ‘x’){
break;
}
else{
cout<<(“Invalid operation. Try again.”);

}

    
}

}

hey @Shortcuttohell, please share the code saved in coding blocks ide as text gets mismatched here

hey @Shortcuttohell, there are so many errors in your code including while condition so you code is going to infinite loop. I have corrected your code, you can check it here https://ide.codingblocks.com/s/140338

Wow. Thanks a lot but still test case is not working because in line 29 and 35, we can’t use the b!=0 if we don’t give b any initialization, i removed it and it is working perfect.

hey @Shortcuttohell, sorry I don’t get your point.

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.