Fizz Buzz in Every Language

Fizz Buzz in Every Language Featured Image

As the Sample Programs in Every Language collection grows, I’ve been compelled to add another project to the series: Fizz Buzz in Every Language.

Table of Contents

What is Fizz Buzz?

For first timers, Fizz Buzz might sound like a children’s cartoon. In reality, it’s a program that has plagued developers in interviews for ages. In fact, there have been countless articles written on the subject:

So, what is Fizz Buzz? Well, for the purposes of the Sample Programs repo, I’ve defined the rules as follows:

Write a program that prints the numbers 1 to 100. However, for multiples of three, print “Fizz” instead of the number. Meanwhile, for multiples of five, print “Buzz” instead of the number. For numbers which are multiples of both three and five, print “FizzBuzz”.

In other words, a Fizz Buzz program should have the following output:

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
...
97
98
Fizz
Buzz

If that seems simple enough, why not take a crack at it in one of your favorite languages? We can always use the help! Otherwise, feel free to peruse this series.

Why Fizz Buzz in Every Language?

After creating the Hello World and Reverse a String series, I wanted to expand the collection even more. Unfortunately, I was never sure which direction to take the collection, so I looked for a list of ubiquitous programs. In other words, I wanted to find a set of programs that people commonly want to know how to write. Unfortunately, Google didn’t turn up many results, so I guess that’s a writing opportunity for me.

However, in my searches, I did find two other program collections:

Of course, Fizz Buzz is much easier than 99 Bottles of Beer, so I decided to start with that. Perhaps in the future, we can add 99 Bottle of Beer to the collection.

An Alphabetical List of Languages

As usual, here’s a list of articles organized alphabetically:

  1. Fizz Buzz in PowerShell
  2. Fizz Buzz in Python

As always, thanks for sticking around. If there’s a language missing that you want to see, feel free to drop it down in the comments. I’m always looking to explore new languages.

Also, don’t forget to subscribe, so you can keep up with the latest articles.

Series Navigation← Reverse a String in DartFile IO in Every Language →

Jeremy Grifski

Jeremy grew up in a small town where he enjoyed playing soccer and video games, practicing taekwondo, and trading Pokémon cards. Once out of the nest, he pursued a Bachelors in Computer Engineering with a minor in Game Design. After college, he spent about two years writing software for a major engineering company. Today, he pursues a PhD in Computer Science in order to ultimately land a teaching gig. In his spare time, Jeremy enjoys spending time with his wife, playing Overwatch, practicing trombone, watching Penguins hockey, and traveling the world.

Recent Content