This page looks best with JavaScript enabled

Fizz Buzz Implementation in javascript, c++,java,c#,python and php

 ·  ☕ 4 min read  ·  👽 john hashim

Fizz Buzz is a very simple programming task, asked in software developer job interviews.

A typical round of Fizz Buzz can be:
Write a program that prints the numbers from 1 to 100 and for multiples of ‘3’ print “Fizz” instead of the number and for the multiples of ‘5’ print “Buzz”.

1
2
3
4
5
6
7
8

for (var i=1; i < 101; i++){
    if (i % 15 == 0) console.log("FizzBuzz");
    else if (i % 3 == 0) console.log("Fizz");
    else if (i % 5 == 0) console.log("Buzz");
    else console.log(i);
}

Share on

john hashim
WRITTEN BY
john hashim
Web Developer