Compilation error

#include
using namespace std;
int main()
{
char ch;
int x=0,y=0;
ch = cin.get();
while(ch!=’\n’)
{

   if(ch=='E' or ch=='e')
   {
       x++;
   }
   else if(ch=='W' or ch=='w')
   {
       x--;
   }
   else if(ch=='N' or ch=='n')
   {
       y++;
   }
   else
   {
       y--;
   }
    ch = cin.get();
}
cout<<"final displacement is "<< x<<" and "<<y;
return 0;

}

why i am getting compilation error in online codingblock ide?

Hey @shubham_jha share your code using ide.codingblocks.com so that i can let you know. Save the code. And after saving it a url will be generated in your search bar. Share that url with me.

I am able to execute in other online ide, but not in codingblock ide. why so?

Share the code i will let you know why it’s not compiling on 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.