Advertisement
noor017

Coordinates of a Point

Jun 6th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     double x, y;
  6.  
  7.     scanf("%lf %lf", &x, &y);
  8.  
  9.          if(x==0.0 && y==0.0)
  10.             {
  11.                 printf("Origem\n");
  12.             }
  13.  
  14.          else if(x>0.0 && y>0.0)
  15.             {
  16.                 printf("Q1\n");
  17.             }
  18.  
  19.          else if(x<0.0 && y>0.0)
  20.             {
  21.                 printf("Q2\n");
  22.             }
  23.  
  24.  
  25.          else if(x<0.0 && y<0.0)
  26.             {
  27.                 printf("Q3\n");
  28.             }
  29.  
  30.          else if(x>0.0 && y<0.0)
  31.             {
  32.                 printf("Q4\n");
  33.             }
  34.  
  35.          else if(x!=0.0 && y==0.0)
  36.             {
  37.                 printf("Eixo X\n");
  38.             }
  39.  
  40.          else if(x==0.0 && y!=0.0)
  41.             {
  42.                 printf("Eixo Y\n");
  43.             }
  44.  
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement