At its most basic purpose, a loop executes a statement of code within its block bounds repeatedly until a defined condition equates to falsy; i.e the statements of code runs again and again till eventually a stated condition curtails further execution of code.
do
{
//code
} while (condition)
Note:
Please note that for every loop, the code is run before the condition is checked. This is best illustrated in code for commit 1
In commit 2, we see how a do while loop works for a counter that
- Execution procedure of a do-while loop