A

Admin • 828.03K Points
Coach

Q. What is the output of the following code?
int i = 0;
while(i < 3) {
System.out.print(i);
i++;
}

  • (A) 0123
  • (B) 012
  • (C) 123
  • (D) 01
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
Loop prints i from 0 to 2.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.