Anonymous user
Loops/Continue: Difference between revisions
→{{header|REXX}}: used a better illustration of the ITERATE statement, added comments and whitespace. -- ~~~~
(Added F# solution. Added note regarding COBOL's CONTINUE verb.) |
(→{{header|REXX}}: used a better illustration of the ITERATE statement, added comments and whitespace. -- ~~~~) |
||
Line 1,068:
=={{header|REXX}}==
(This program could be simplier by using a '''then/else''' construct, but an '''iterate''' was used to conform to the task.)
<lang rexx>/*REXX program
do j=1 for 10 /*equivalent to: DO J=1 TO 10 */
if j//5\==0 then do /*Not a multiple of five? Then..*/
call charout , ", " /*write a comma to the terminal, */
iterate
say
/*stick a fork in it, we're done.*/</lang>
Program note: the comma (,) immediately after the '''charout''' BIF indicates to use the terminal output stream.
<br><br>
=={{header|Ruby}}==
|