Advertisement
Guest User

Lab 3_1_1 Point checker Final

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h> 
  3. #include <stdbool.h> 
  4.  
  5. int main()
  6. {
  7.     float x,y;
  8.     bool condition;
  9.  
  10.     printf("Enter x y\n");
  11.     scanf("%f %f",&x, &y);
  12.     condition=(x>0 && y>0 && y<=-1*x+1);
  13.             if (condition) printf ("Exist in first quarter\n");
  14.             else printf ("Don't exist in first quarter\n");
  15.     condition=(x<0 && y>0);
  16.             if (condition) printf ("Don't exist in second quarter\n");
  17.             else printf ("Don't exist in second quarter\n");
  18.     condition=(x<0 && y<0 && ((x*x)+(y*y))<=1);
  19.             if (condition) printf ("Exist in third quarter\n");
  20.             else printf ("Don't exist in third quarter\n");
  21.     condition=(x>0 && y<0 && y>=x-2 && ((x*x)+(y*y))>=1);
  22.             if (condition) printf ("Exist in fourth quarter\n");
  23.             else printf ("Don't exist in fourth quarter\n");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement