Anonymous user
Loops/Do-while: Difference between revisions
no edit summary
m ({{omit from|GUISS}}) |
No edit summary |
||
Line 476:
} while (x % 6 != 0)</lang>
=={{header|
In NetRexx the '''do–while''' construct is implemented via the <code>until ''expru''</code> conditional clause of the <code>loop</code> instruction. The expression ''expru'' in the <code>until ''expru''</code> clause is evaluated at the end of the loop, guaranteeing that the loop will be executed at least once.
<lang objeck>▼
<lang NetRexx>/* NetRexx */
i := 0;▼
options replace format comments java crossref savelog symbols nobinary
do {▼
i->PrintLine();▼
say
i += 1;▼
say 'Loops/Do-while'
} ▼
while (i % 6 <> 0);▼
i_ = 0
loop until i_ // 6 = 0
i_ = i_ + 1
say i_
end
</lang>
Line 495 ⟶ 500:
in
loop 0</lang>
=={{header|Objeck}}==
▲<lang objeck>
▲i := 0;
▲do {
▲ i->PrintLine();
▲ i += 1;
▲}
▲while (i % 6 <> 0);
</lang>
or implementing a generic do-while iterator with higher order function:
|