C Program to accept two integers for a co-ordinate point and determine its Quadrant.

C program to accept two integers for a co-ordinate point and determine its Quadrant. A Cartesian coordinate system specifies each point uniquely in a plane by a pair of numerical coordinates, which are the signed distances from the point to two fixed perpendicular directed lines, measured in the same unit of length.
The left to right (horizontal) direction is commonly called X-Axis.
The up to down (vertical) direction is commonly called Y-axis.
The X and Y axises divide the plane into four regions, called as the quadrant. Read more about C Programming Language .

/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
#include<stdio.h>
int main()
{
int x,y;
printf("Enter the values for coordinates x and y\n");
scanf("%d%d",&x,&y);
if((x>=0) &&(y>=0))
{
printf("\n The co-ordinate (%d,%d) is in first Quardrant\n",x,y);
}
else if((x<0) &&(y<0))
{
printf("\n The co-ordinate (%d,%d) is in Third Quardrant\n",x,y);
}
else if((x>0) &&(y<0))
{
printf("\n The co-ordinate (%d,%d) is in Fourth Quardrant\n",x,y);
}
else {
printf("\n The co-ordinate (%d,%d) is in Second Quardrant\n",x,y);
}
return 0;
}
/* Author: Sandeepa Nadahalli */
view raw quadrant.c hosted with ❤ by GitHub

Read more Similar C Programs
Searching in C

C Strings

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com

Leave a Reply