-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointLocation.cpp
More file actions
52 lines (51 loc) · 1.29 KB
/
Copy pathpointLocation.cpp
File metadata and controls
52 lines (51 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
using namespace std;
int main()
{
cout << "\n.................Program to find point location................\n";
int x, y;
cout << "enter x cordinate: ";
cin >> x;
cout << "enter y cordinate: ";
cin >> y;
// solution
if (x == 0)
{
if (y == 0)
{
cout << "point ( " << x << "," << y << " ) lies at origin\n";
}
else
{
cout << "point ( " << x << "," << y << " ) lies at y-axis\n";
}
}
else if (y == 0)
{
if (x == 0)
{
cout << "point ( " << x << "," << y << " ) lies at origin\n";
}
else
{
cout << "point ( " << x << "," << y << " ) lies at x-axis\n";
}
}
else if (x > 0 && y > 0)
{
cout << "point ( " << x << "," << y << " ) lies in the first coordinate\n";
}
else if (x < 0 && y > 0)
{
cout << "point ( " << x << "," << y << " ) lies in the second coordinate\n";
}
else if (x < 0 && y < 0)
{
cout << "point ( " << x << "," << y << " ) lies in the third coordinate\n";
}
else
{
cout << "point ( " << x << "," << y << " ) lies in the fourth coordinate\n";
}
return 0;
}