Machine-translated by Google. Questions are authored in English.
Top

Discussion

A do-while loop terminates when its controlling expression evaluates to

  • A.One
  • B.Zero
  • C.Non - zero
  • D.None of the above

Answer: B

Correct answer: Zero

A loop continues while its condition is true, that is non-zero, and stops when it evaluates to zero. The do-while differs from the others only in when the test happens - after the body rather than before - so the body always runs at least once.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.