Question #292403

What happens if the condition in a while loop is initially false? Explain and differentiate


between while and do while statement in ā€˜C’ language.

Expert's answer

If the condition in a while loop is initially false, then the loop will not be executed once.

In loop do-while, unlike a while one, the termination condition is checked after the body of the loop is executed. Thus, the body of the do-while loop will be executed at least once, regardless of its termination condition.


LATEST TUTORIALS
APPROVED BY CLIENTS