A

Admin • 828.43K Points
Coach

Q. What will be the output of the following Java program?

Code:
class selection_statements
{
public static void main(String args[])
{
int var1 = 5;
int var2 = 6;
if ((var2 = 1) == var1)
System.out.print(var2);
else
System.out.print(++var2);
}
}
  • (A) 1
  • (B) 2
  • (C) 3
  • (D) 4
  • Correct Answer - Option(B)
  • Views: 25
  • 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.