What will be the output of the following code?

Last Updated :
Discuss
Comments

What will be the output of the following code?

Java
int x = 5; if (x > 2)  if (x > 4)  System.out.println("A");  else  System.out.println("B"); 


A

B

Compilation Error

No Output


Share your thoughts in the comments