Fizz Buzz in Zig

Published on 08 January 2025 (Updated: 08 January 2025)

Welcome to the Fizz Buzz in Zig page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

const std = @import("std");

pub fn main() !void {
    const stdout = std.io.getStdOut().writer();
    var i: usize = 1;
    while (i <= 100) : (i += 1) {
        if (i % 15 == 0) {
            try stdout.writeAll("FizzBuzz\n");
        } else if (i % 3 == 0) {
            try stdout.writeAll("Fizz\n");
        } else if (i % 5 == 0) {
            try stdout.writeAll("Buzz\n");
        } else {
            try stdout.print("{d}\n", .{i});
        }
    }
}

Fizz Buzz in Zig 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.