write a program that will take the x and y coordinates of a point and tell us wh
ID: 3639610 • Letter: W
Question
write a program that will take the x and y coordinates of a point and tell us what quadrant the point is in or if the point sits on the coordinate line, what line it sits on.Recall that in Quadrant 1 both x and y are positive, in Quadrant 2 x is negative and y is positive, in Quadrant 3 both x and y are negative adn in Quadrant 4 x is positive and y is negative.
therefore
(-1.0,-2.4) is in quadrant 3 and
(0.0, 4.8) is on the y axis.
Explanation / Answer
#include #include main() { int x, y; printf("Enter coordinate pair: "); scanf("%d %d", &x, &y); if (x = 0 && y > 0) printf("Positive y Axis"); else if (x > 0 && y = 0) printf("Positive x Axis"); else if (x < 0 && y = 0) printf("Negative x Axis"); else if (x = 0 && y < 0) printf("Negative y Axis"); else if (x > 0 && y > 0) printf("1st Quadrant"); else if (x < 0 && y > 0) printf("2nd Quadrant"); else if (x < 0 && y < 0) printf("3rd Quadrant"); else if (x > 0 && y < 0) printf("4th Quadrant"); }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.