#include <stdio.h>
int main(){
int x;
int y;
printf("Enter the x-y coordinate of a point in a Cartesian plane: ");
scanf("%d%d", &x,&y);
if (x == 0 && y == 0){
printf("(%d,%d) is the origin",x,y);
}else if (y == 0){
printf("(%d,%d) is on the x-axis",x,y);
}else if (x == 0){
printf("(%d,%d) is on the y-axis",x,y);
}else if (y > 0){
if (x > 0){
printf("(%d,%d) is in the first quadrant",x,y);
}else{
printf("(%d,%d) is in the second quadrant",x,y);
}
}else{
if (x < 0){
printf("(%d,%d) is in the third quadrant",x,y);
}else{
printf("(%d,%d) is in the fourth quadrant",x,y);
}
}
scanf("%d", &x);
return 0;
}
Comments
Leave a comment