C Program to Check the Quadrant of X and Y Coordinates


How This Program Works?

First, we'll write a function in which we'll create 4 conditions to check whether number lies in the first, second, third or fourth quadrant.

  1. For first quadrant value of x and y should be greater than 0.
  2. For the second quadrant value of x should be less than 0 and the value of y should be greater than 0.
  3. For the third quadrant value of x should be less than 0 and the value of y should be greater than 0.
  4. For the fourth quadrant value of x should be greater than 0 and the value of y should be less than 0.

Then in the main method, we'll take the value of x and y from the user and pass the value to the function to check in which quadrant value lies.

C Program to Check the Quadrant of X and Y Coordinates

You May Also Like:



Comments

Popular posts from this blog

Pseudocode to Check, Number is Odd or Even

How to Create Marksheet in C