Doubt on code on short string

#include
using namespace std;

int main()
{

char ch;
ch = cin.get();

int x = 0;
int y = 0;

while (ch != "/n"){


    if (ch == ' N ' & ch == ' n')
    {
        y++;
    }

    else if (ch == 'E' & ch == 'e')
    {

        x++;
    }
    else if (ch == 'S' & ch == 's')
    {

        y--;
    }
    else
    {

        x--;
    }

    ch = cin.get();
}

cout << "final displacement of " << x << "and " << y << endl;

return 0;

}

Hello @vishnim could you please share the question screenshot or link so that i can see what is the exact pattern and everything?

PROGRAMING FUNDAMENTAL-II SHORTEST PATH STRING

@vishnim check this:
https://ide.codingblocks.com/s/414671
use or in the if condition.
Happy Learning!!

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.