Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int x,y;
- printf("Enter the value of x ");
- scanf("%d",&x);
- printf("Enter the value of y ");
- scanf("%d",&y);
- if(x>0)
- {
- if(y>0)
- {
- printf("The coordinate point (%d,%d) lies in the first quadrant",x,y);
- }
- else if(y<0)
- {
- printf("The coordinate point (%d,%d) lies in the fourth quadrant",x,y);
- }
- else if(y==0)
- {
- printf("The coordinate point (%d,%d) lies on the x axis",x,y);
- }
- }
- else if(x<0)
- {
- if(y>0)
- {
- printf("The coordinate point (%d,%d) lies in the second quadrant",x,y);
- }
- else if(y<0)
- {
- printf("The coordinate point (%d,%d) lies in the third quadrant",x,y);
- }
- else if(y==0)
- {
- printf("The coordinate point (%d,%d) lies on the x axis",x,y);
- }
- }
- else if(y>0 && x==0)
- {
- printf("The coordinate point (%d,%d) lies on the y axis",x,y);
- }
- else if(y<0 && x==0)
- {
- printf("The coordinate point (%d,%d) lies on the y axis",x,y);
- }
- else
- {
- printf("The point is in the center");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement