File tree 1 file changed +17
-9
lines changed
1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
using namespace std ;
3
-
3
+
4
4
int main ()
5
5
{
6
+ // Delcare float variable for x and y co-ordinates and input it
6
7
float x, y;
7
8
cin >> x >> y;
8
-
9
+
10
+ // If both x and y coordinates are zero then point at on origin
9
11
if (x == 0 && y == 0 )
10
12
cout << " Origem" ;
11
-
13
+
14
+ // If both x and y coordinates are greater than zero then the point lies in first quadrant
12
15
else if (x > 0 && y > 0 )
13
16
cout << " Q1" ;
14
-
17
+
18
+ // If the x coordinate is greater than zero and y is less then point lies in fourth quadrant
15
19
else if (x > 0 && y < 0 )
16
20
cout << " Q4" ;
17
-
21
+
22
+ // If x is coordinate is less than zero and y is greater then point lies in second quadrant
18
23
else if (x < 0 && y > 0 )
19
24
cout << " Q2" ;
20
-
25
+
26
+ // If both x and y coordinates are less than zero then point lies in third quadrant
21
27
else if (x < 0 && y < 0 )
22
28
cout << " Q3" ;
23
-
29
+
30
+ // If x coordinate is zero then the point lies on y axis
24
31
else if (x == 0 && y != 0 )
25
32
cout << " Eixo Y" ;
26
-
33
+
34
+ // If x coordinate is zero then the point lies on y axis
27
35
else if (y == 0 && x != 0 )
28
36
cout << " Eixo X" ;
29
-
37
+
30
38
return 0 ;
31
39
}
You can’t perform that action at this time.
0 commit comments