int x = 5;
int y = 10;
if (x > 0) {
if (y > x) {
System.out.println("A");
} else {
System.out.println("B");
}
} else {
System.out.println("C");
}What is printed?
- Acheck_circle
A
- B
B
- C
C
- D
A B
Explanation
x > 0 is true, so we enter the outer if. y > x is 10 > 5, true, so "A" is printed.