Problem of the Day: problemoftheday

This is similar to the “FizzBuzz” problem that seems to be pretty popular in technical interviews. I think I used if-else statements when I did it. In this case it’d be very similar other than for “fizzbuzz” I checked higher-level multiples first; in order to print “problemoftheday” properly it has to go lower-to-higher multiples. But let’s see.

problemoftheday

You’ve got an easy one for today. Create a program that iterates over the numbers [1-100] (inclusive). If a number is divisible by 1 print “problem”. If a number is divisible by 5 print “of”. If a number is divisible by 25 print “the”. If a number is divisible by 100 print “day”. Thus when you reach 100 your final line of output should be “problemoftheday”.

X