-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNested.java
35 lines (35 loc) · 840 Bytes
/
Nested.java
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
import java.util.Scanner;
public class Nested
{
public static void main(String ar[])
{
Scanner s = new Scanner(System.in);
System.out.println("Enter first number");
int a = s.nextInt();
System.out.println("Enter Second Number");
int b = s.nextInt();
if(a>b)
{
if(b>0)
{
System.out.println("A is positive");
}
else
{
System.out.println("A is positive but B is not");
}
}
else
{
if(a>0)
{
System.out.println("B is positive");
}
else
{
System.out.println("B is positive but A is not");
}
}
System.out.println("Exit");
}
}