Shortest Road Trip

Code is not giving any output

#include
using namespace std;
int main()
{
char ch;
int x=0,y=0;
cout<<"Enter the directions(in capitals): ";
ch=cin.get();
while (ch!=’\0’)
{
switch(ch)
{
case ‘N’ : y++; break;
case ‘S’ : y–; break;
case ‘E’ : x++; break;
case ‘W’ : x–; break;
}
ch=cin.get();
}
if (x>=0&&y>=0)
{
cout<<"The shortest route possible is: ";
for (int i=0;i<=y;i++)
{
cout<<“N”;
}
for (int i=0;i<=x;i++)
{
cout<<“E”<<endl;
}
}
if (x>=0&&y<=0)
{
cout<<"The shortest route possible is: ";
for (int i=0;i>=y;i–)
{
cout<<“S”;
}
for (int i=0;i<=x;i++)
{
cout<<“E”<<endl;
}
}
if (x<=0&&y>=0)
{
cout<<"The shortest route possible is: ";
for (int i=0;i<=y;i++)
{
cout<<“N”;
}
for (int i=0;i>=x;i–)
{
cout<<“W”<<endl;
}
}
if (x<=0&&y<=0)
{
cout<<"The shortest route possible is: ";
for (int i=0;i>=y;i–)
{
cout<<“S”;
}
for (int i=0;i>=x;i–)
{
cout<<“W”<<endl;
}
}

return 0;

}

Hey Manan, can you copy your code in ide, save it and share that link here. this copied code is giving many compilation errors here.