A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Fizz Buzz in COBOL page! Here, you'll find the source code for this program as well as a description of how the program works.
identification division.
program-id. fizz-buzz.
data division.
working-storage section.
01 counter pic 9(3).
01 counter-out pic z(3).
procedure division.
main.
perform varying counter from 1 by 1 until counter > 100
evaluate true
when function mod(counter, 15) = 0
display "FizzBuzz"
when function mod(counter, 3) = 0
display "Fizz"
when function mod(counter, 5) = 0
display "Buzz"
when other
move counter to counter-out
display function trim(counter-out)
end-evaluate
end-perform
stop run.
Fizz Buzz in COBOL was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.