11.
12.
13.
The main difference between a while loop and a do-while loop lies in when the loop condition is checked:
- While Loop:
- In a while loop, the condition is checked before the loop body is executed.
- If the condition is false initially, the loop body will not execute at all.
- Do-While Loop:
- In a do-while loop, the condition is checked after the loop body is executed.
- This guarantees that the loop body will execute at least once, even if the condition is false initially.
14.
15.