Answer to Question #24224 in C++ for sanjida islam

Question #24224
given a point (x,y),write a program to find out if lies on the x-axis and y-axis or at the origin and which quardent they belong to
1
Expert's answer
2013-02-28T08:50:35-0500
#include <iostream>
using namespace std;
int main (){

double x,y;
cout<<"Enter x, y\n";
cin>>x>>y;
if (x == 0 && y == 0) cout<< "point at the origin\n";
else if (x == 0) cout<< "point at the x-axis\n";
else if (y == 0) cout<< "point at the y-axis\n";
else if (x > 0 && y > 0) cout<< "point at the first quadrant\n";
else if (x < 0 && y > 0) cout<< "point at the second quadrant\n";
else if (x < 0 && y < 0) cout<< "point at the third quadrant\n";
else if (x > 0 && y < 0) cout<< "point at the fourth quadrant\n";


system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS