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";
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment