How to solve runguard error in this particular program?

#include
using namespace std;
int main() {
char ch;
do{
cin>>ch;
int N1,N2;
switch(ch){
case β€˜+’:
cin>>N1>>N2;
cout<<N1+N2<<endl;
break;
case β€˜-’:
cin>>N1>>N2;
cout<<N1-N2<<endl;
break;
case '’:
cin>>N1>>N2;
cout<<N1
N2<<endl;
break;
case β€˜/’:
cin>>N1>>N2;
if(N2!=0){
cout<<N1/N2<<endl;}
break;
case β€˜%’:
cin>>N1>>N2;
if(N2!=0){
cout<<N1%N2<<endl;
break;}
case β€˜X’:
case β€˜x’:
break;
default:
cout<<β€œinvalid operation.Try again”<<endl;
}}while(true);
return 0;
}

hi @goutampopli12,
please send me code on ide.codingblocks.com

  1. login
  2. write (or copy paste)
  3. save (ctrl + s)
  4. send the url of that page

or send it by saving to any online editor

hi @goutampopli12, updated and commented

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.