Q. What would be the output of the following code snippet if variable a=10?
Code:
if(a<=0)
{
if(a==0)
{
System.out.println("1 ");
}
else
{
System.out.println("2 ");
}
}
System.out.println("3 ");
β
Correct Answer: (D)
3