Write a program that prints every number from 1 to 100.
- For integers that are multiples of 3, print "Fizz".
- For integers that are multiples of 5, print "Buzz".
- For integers that are multiples of both 3 and 5, print "FizzBuzz".
I did this purely for fun, since this is apparently hard for some programmers.
Facebook has their own variant of this test (or used to, at least). In their variant (called "Hoppity Hop!"), you are to do the following:
Write a program to iterate over all integers (inclusive) from 1 to N.
- For integers that are evenly divisible by three, print "Hoppity"
- For integers that are evenly divisible by five, print "HopHop"
- For integers that are evenly divisible by both three and five, print just "Hop"
- For all other integers, print nothing.