Jump to content

Loops/Do-while: Difference between revisions

no edit summary
m ({{omit from|GUISS}})
No edit summary
Line 476:
} while (x % 6 != 0)</lang>
 
=={{header|ObjeckNetRexx}}==
In NetRexx the '''do&ndash;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:
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.