Tim Akinbo posted this on his website today and threw down a challenge. Here’s my humble attempt at solving the problem. It took a little under 20 minutes.

### The challenge statement:

This is the fabled Fizzbuzz problem, which is said that most programmers cant solve in longhand. Its a common question asked in programming interviews.

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

### My suggestion

This is a program written in python, we loop through the values from 1 to 100. Test for multiples of 15, then multiples of 5 and multiples of 3. Others will be printed as is.

for n in range(1, 101):if ((n % 15) == 0):print "FizzBuzz",elif ((n % 5) == 0):print "Buzz",elif ((n % 3) == 0):print "Fizz",else:print n,