Write a program to input x and y coordinates of a point in the cartesian plane and print a message indicating the point is the origin or lies on a particular
quadrant.
quadrant.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nishant MittalPosted Jan 13, 2016, 4:55 AM
class cartesianPlane
{
public :
long x,y;
int main()
{
cout<<"Enter value of X and Y";
cin>>x;
cin>>y;
cout<<"entered value of X :" << x <<"and Y:"<< y<< endl;
if(x<0)
{
if(y<0)
{
cout<<"points are in 3rd quadrent";
}
else
{
cout<<"points are in 4nd quadrent";
}
}
else if(x>0)
{
if(y>0)
{
cout<<"points are in 1st quadrent";
}
else
{
cout<<"points are in 2nd quadrent";
}
}
else if(x==0 & y==0)
{
cout<<"point are at origion";
}
return 0;
}
}
Thanks ‘n’ Regards,
Vivek Kumar
Senior Software Engineer