Difference between While loop and dowhile loop in MSW Logo:-
The while loop checks the condition at the starting of the loop and if the condition is satisfied statement inside the loop, is executed. As against, in the do-while loop, the condition is checked after the execution of all statements in the body of the loop.
The while loop is also known as the entry-controlled and pre-checking loop because in this loop, the body of the loop is executed prior to checking the condition. Conversely, the alternate name for the do-while loop is the exit-controlled and post-checking loop, the reason behind this is that the checking of the loop condition is followed by the execution of the body of the loop.
If the condition in a while loop is false, not a single statement inside the loop is executed. In contrast, if the condition in ‘do-while’ loop is false, then also the body of the loop is executed at least once then the condition is tested.
The syntax of a do-while loop includes a semi-colon to terminate the loop. On the contrary, there is no use of the semi-colon in the while loop syntax.
Answers & Comments
Answer:
Difference between While loop and do while loop in MSW Logo:-
Answer:
Hey mate. here's an attach.
Explanation:
Hope it's helpful and thanks for the outstanding answer's you provide.