Advertisement
labib24

Untitled

Jan 13th, 2023
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int x,y;
  5.     printf("Enter the value of x ");
  6.     scanf("%d",&x);
  7.     printf("Enter the value of y ");
  8.     scanf("%d",&y);
  9.     if(x>0)
  10.     {
  11.         if(y>0)
  12.         {
  13.             printf("The coordinate point (%d,%d) lies in the first quadrant",x,y);
  14.         }
  15.         else if(y<0)
  16.         {
  17.             printf("The coordinate point (%d,%d) lies in the fourth quadrant",x,y);
  18.         }
  19.         else if(y==0)
  20.         {
  21.           printf("The coordinate point (%d,%d) lies on the x axis",x,y);
  22.         }
  23.     }
  24.     else if(x<0)
  25.     {
  26.         if(y>0)
  27.         {
  28.             printf("The coordinate point (%d,%d) lies in the second quadrant",x,y);
  29.         }
  30.         else if(y<0)
  31.         {
  32.             printf("The coordinate point (%d,%d) lies in the third quadrant",x,y);
  33.         }
  34.         else if(y==0)
  35.         {
  36.           printf("The coordinate point (%d,%d) lies on the x axis",x,y);
  37.         }
  38.     }
  39.     else if(y>0 && x==0)
  40.     {
  41.         printf("The coordinate point (%d,%d) lies on the y axis",x,y);
  42.     }
  43.     else if(y<0 && x==0)
  44.     {
  45.         printf("The coordinate point (%d,%d) lies on the y axis",x,y);
  46.     }
  47.     else
  48.     {
  49.         printf("The point is in the center");
  50.     }
  51.  
  52. }
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement