Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int x, y;
- for (int i = 0; i <= 5; i++) {
- printf("\nPlease enter a point in form x,y\n");
- scanf_s("%d,%d", &x, &y);
- if (x>0 && y>0) printf("\nQuadrant 1");
- else if (x<0 && y>0) printf("\nQuadrant 2");
- else if (x<0 && y<0) printf("\nQuadrant 3");
- else if (x>0 && y<0) printf("\nQuadrant 4");
- else if (x == 0 && y==0) printf("\nPoint is on the origin");
- else if (x == 0) printf("\nPoint is on the x axis");
- else if (y == 0) printf("\nPoint is on the y axis");
- }
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment