EWSN (East, West, South, North) - Insurance Tips

A Hub of Best Guide Health Insurance Tips

Saturday, March 28, 2020

EWSN (East, West, South, North)

#include
#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