Loop with condition on the beginning until is false: until, do until loop
Condition testing is done at the beginning of the loop. before each iteration the condition is tested, if it is was false. before the first iteration is a condition test, the use of this loop is excellent in situations where perhaps we don't need to execute the cycle.until
Description
until (condition) statement
Input
- condition - Logical value The condition can be any expression
- statement - statements
Examples
Example
i = x * 5;
until (i == 0)
if (i==10)
break;
else
{
i--;
}
do until loop
Description
do until condition
statements
loop
Input
- condition - Logical value The condition can be any expression
- statements - statements
Examples
Basic
i = x * 5
do until i = 0
if i=10 then
exit do
else
i=i-1
end if
loop
Loop with condition on the beginning until is false in another programming language: