-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuadrant.java
More file actions
30 lines (27 loc) · 861 Bytes
/
Quadrant.java
File metadata and controls
30 lines (27 loc) · 861 Bytes
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
package javbasic;
import java.util.Scanner;
public class Quadrant {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x,y;
System.out.println("Enter the value of x :");
x=sc.nextInt();
System.out.println("Enter the value of y :");
y=sc.nextInt();
if(x==0&&y==0)
System.out.println("Point lies on the origin");
else if(x>0&&y>0)
System.out.println("Point lies in first quadrant");
else if(x<0&&y>0)
System.out.println("Point lies in the second quadrant");
else if(x<0&&y<0)
System.out.println("Point lies in the third quadrant ");
else if (x>0&&y<0)
System.out.println("Point lies in the fourth quadrant ");
else if(x>0&&y==0)
System.out.println("Point lies on the X axis");
else
System.out.println("Point lies on the Y axis");
sc.close();
}
}