Fizz Buzz in COBOL

Published on 19 April 2026 (Updated: 19 April 2026)

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.

Current Solution

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.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.