Problem 25: Coordinate

Take two integers indicating the x and y coordinate of a two-dimensional graph paper where the center point is x = 0 and y = 0. Now print the quadrant of the given point. [If user gives input (4,5) you should print ‘First quadrant’; If user gives input (-4,-5) you should print ‘Third quadrant’ ]

 

2,156 total views, 2 views today

Comments

comments

One thought on “Problem 25: Coordinate”

  1. nclude
    main()
    {
    int x,y;
    scanf(“%d %d”,&x,&y);
    if (x>0 && y>0)
    {
    printf(“first coordinate”);
    }
    else if (x>0 && y<0)
    {
    printf("second coordinate");
    }
    else if (x<0 && y<0)
    {
    printf("third coordinate");
    }
    else if (x0)
    {
    printf(“fourth coordinate”);
    }
    }

Leave a Reply

Your email address will not be published.