-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask6.java
More file actions
36 lines (36 loc) · 1.07 KB
/
Task6.java
File metadata and controls
36 lines (36 loc) · 1.07 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
/*Write a Java program to accept a coordinate point in a XY
coordinate system and determine its quadrant.
*/
import java.util.*;
class Quardent
{
public static void main(String... args)
{
Scanner s=new Scanner(System.in);
long X,Y;
System.out.print("Enter the value of Abscissa (X)=");
X=s.nextLong();
System.out.print("Enter the value of Ordinate (Y)=");
Y=s.nextLong();
if(X>0 && Y>0)
{
System.out.print("Cordinate belong in First Cordinate"+"("+X+","+Y+")");
}
else if(X<0 && Y>0)
{
System.out.print("Cordinate belong in 4th Cordinate"+"("+X+","+Y+")");
}
else if(X>0 && Y<0)
{
System.out.print("Cordinate belong in 2nd Cordinate"+"("+X+","+Y+")");
}
else if(X<0 && Y<0)
{
System.out.print("Cordinate belong in 3rd Cordinate");
}
else
{
System.out.print("Cordinate present at origin"+"("+X+","+Y+")");
}
}
}