A

Admin • 828.03K Points
Coach

Q. How many times will the loop run?
int i = 0;
while(i > 0) {
System.out.println(i);
}

  • (A) Infinite times
  • (B) 1 time
  • (C) 0 times
  • (D) Depends on JVM
  • Correct Answer - Option(C)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
The condition is false at the beginning, so the loop doesn't run.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.