Oh foo-ie!

Question

Write a function that takes in an integer n, and prints out integers from 1 to n inclusive.

Additionally, if %3 == 0 then print
"foo" in place of the integer, if %5 == 0 then print "ie" in place of the integer, and if both conditions are true then print "foo-ie" in place of the integer.

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now