A

Admin • 828.03K Points
Coach

Q. What is printed?
for(int i=0;i<3;i++){
if(i==1) break;
System.out.print(i);
}

  • (A) 0
  • (B) 01
  • (C) 012
  • (D) 1
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
When i becomes 1, break stops the loop, so only 0 is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.