BladeMechanics

Point

Aug 7th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. void main()
  5. {
  6. int x, y;
  7. for (int i = 0; i <= 5; i++) {
  8. printf("\nPlease enter a point in form x,y\n");
  9. scanf_s("%d,%d", &x, &y);
  10. if (x>0 && y>0) printf("\nQuadrant 1");
  11. else if (x<0 && y>0) printf("\nQuadrant 2");
  12. else if (x<0 && y<0) printf("\nQuadrant 3");
  13. else if (x>0 && y<0) printf("\nQuadrant 4");
  14. else if (x == 0 && y==0) printf("\nPoint is on the origin");
  15. else if (x == 0) printf("\nPoint is on the x axis");
  16. else if (y == 0) printf("\nPoint is on the y axis");
  17. }
  18. _getch();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment