C Program To Check In Which Quadrant The Point Lies



C Program To Check In Which Quadrant The Point Lies

C Program To Check In Which Quadrant The Point Lies

http://technotip.com/7172/c-program-to-check-in-which-quadrant-the-point-lies/

Lets write a C program to determine the position of point(x,y) on the graph of x and y axis.

Logic To Check The Position of the Point in the graph
We check for 9 conditions to determine the position of the user entered point in the graph:

1. Point lies on (0, 0): Origin
2. y = 0 and x is greater than 0. i.e., x is positive: point lies on positive side of x-axis.
3. x = 0 and y is greater than 0. i.e., y is positive: point lies on positive side of y-axis.
4. y = 0 and x is less than 0. i.e., x is negative: point lies on negative side of x-axis.
5. x = 0 and y is less than 0. i.e., y is negative: point lies on negative side of y-axis.
6. x is greater than 0 and y greater than 0. i.e., both x and y are positive: point lies in First Quadrant.
7. x is less than 0 and y is greater than 0. i.e., x is negative and y is positive: point lies in Second Quadrant.
8. x is less than 0 and y is less than 0. i.e., both x and y are negative: point lies in Third Quadrant.
9. x is greater than 0 and y is less than 0. i.e., x is positive and y is negative: point lies in Forth Quadrant.

C Programming Interview / Viva Q&A List
http://technotip.com/6378/c-programming-interview-viva-qa-list/

C Programming: Beginner To Advance To Expert
http://technotip.com/6086/c-programming-beginner-to-advance-to-expert/

Comments are closed.