A

Admin • 830.13K Points
Coach

Q. What is the result?
for (int i = 0; i < 1; i--)

  • (A) Prints 0
  • (B) Prints nothing
  • (C) Infinite loop
  • (D) Error
  • Correct Answer - Option(C)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
i is decremented; condition i < 1 is always true – infinite loop.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.