Loops/While: Difference between revisions

Content added Content deleted
No edit summary
(Added COBOL example.)
Line 207: Line 207:
(doseq [i (take-while pos? (iterate #(quot % 2) 1024))]
(doseq [i (take-while pos? (iterate #(quot % 2) 1024))]
(println i))</lang>
(println i))</lang>

=={{header|COBOL}}==
COBOL does not have a while loop construct, but it is does have a <code>PERFORM UNTIL</code> structure, which means that the normal condition used in a while loop must be negated.
<lang cobol> IDENTIFICATION DIVISION.
PROGRAM-ID. Loop-While.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 I PIC 9999 VALUE 1024.

PROCEDURE DIVISION.
PERFORM UNTIL NOT 0 < I
DISPLAY I
DIVIDE 2 INTO I
END-PERFORM

GOBACK
.</lang>


=={{header|ColdFusion}}==
=={{header|ColdFusion}}==