A

Admin • 828.43K Points
Coach

Q. What is the result of this code?
int i = 5;
do {
System.out.print(i);
i--;
} while(i > 5);

  • (A) 5
  • (B) 4
  • (C) 54
  • (D) Nothing
  • Correct Answer - Option(A)
  • Views: 14
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
do-while runs once even if the condition is false initially.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.