#include
using namespace std;
int main()
{
int x=0,y=0;
char ch;
cin>>ch;
while(ch!=’\n’)
{
if(ch==‘n’)
y++;
else if(ch==‘s’)
y–;
else if(ch==‘e’)
x++;
else if(ch==‘w’)
x–;
cin>>ch;
}
cout<<x<<" “<<y<<” are the required coordinates";
return 0;
}
why my code is not working if i dont use cin.get() and simply take char as input,please make me understand