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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nishant MittalRank #692 · 3.5K reputationPosted Jan 12, 2016, 11:55 PM EST
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