Contact Learn C
Copy Program Share Program

Program 172:To find Quadrant of given Co-Ordinates

Program 172:
 
#include<stdio.h>
main()
{
float x,y;
printf("Enter (x,y) Co-Ordinates\n");
scanf("%f %f",&x,&y);

if(x>0&&y>0)
{
 printf("Co-Ordianates (%f,%f) lies in First Quadrant\n",x,y);
}
if(x<0&&y>0)
{
 printf("Co-Ordianates (%f,%f) lies in Second Quadrant\n",x,y);
}
if(x<0&&y<0)
{
 printf("Co-Ordianates (%f,%f) lies in Third Quadrant\n",x,y);
}
if(x>0&&y<0)
{
 printf("Co-Ordianates (%f,%f) lies in Fourth Quadrant\n",x,y);
}

if(x==0&&y==0)
{
 printf("Co-Ordianates (%f,%f) lies at the Origin\n",x,y);
}
}

Explanation:







Output:




 

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide