A

Admin • 828.03K Points
Coach

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 ");
  • (A) 1 2
  • (B) 2 3
  • (C) 1 3
  • (D) 3
  • Correct Answer - Option(D)
  • Views: 17
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.