#include
using namespace std;
int main()
{
int x=3, y=3;
char c;
cout<<"Enter any character";
c=getch();
if((c=='e')||(c=='E'))
{
--y;
}
else if((c=='W')||(c=='w'))
{
++y;
}
else if((c=='N')||(c=='n'))
{
--x;
}
else if((c=='S')||(c=='s'))
{
++x;
}
else
{
cout<<"\nInvalid character";
}
cout<<"\n\nValue of x="<
No comments:
Post a Comment