FizzBuzz: Difference between revisions

Content added Content deleted
(Add bruijn)
(+BabyCobol)
Line 1,102: Line 1,102:


100 times }</syntaxhighlight>
100 times }</syntaxhighlight>

=={{header|BabyCobol}}==
<syntaxhighlight lang="cobol">
* NB: ANY does not exist in BabyCobol so the elegant
* EVALUATE-based solution is impossible here.
* Note the subtly unbalanced yet valid ENDs at the end.
IDENTIFICATION DIVISION.
PROGRAM-ID. FIZZ BUZZ.
DATA DIVISION.
01 INT PICTURE IS 9(3).
01 REM LIKE INT.
01 TMP LIKE INT.
PROCEDURE DIVISION.
LOOP VARYING I TO 100
DIVIDE INT INTO 3 GIVING TMP REMAINDER REM
IF REM = 0
THEN DISPLAY "Fizz" WITH NO ADVANCING
END
DIVIDE INT INTO 5 GIVING TMP REMAINDER REM
IF REM = 0
THEN DISPLAY "Buzz" WITH NO ADVANCING
END
DIVIDE INT INTO 15 GIVING TMP REMAINDER REM
IF REM = 0
THEN DISPLAY ""
ELSE DISPLAY INT
END.
</syntaxhighlight>


=={{header|BaCon}}==
=={{header|BaCon}}==