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.
- For first quadrant value of x and y should be greater than 0.
- For the second quadrant value of x should be less than 0 and the value of y should be greater than 0.
- For the third quadrant value of x should be less than 0 and the value of y should be greater than 0.
- 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:
- Return Multiple Values from a Function.
- Calculator in C.
- C Program to Convert Fahrenheit into Celsius.
Comments
Post a Comment