Snack Break Problem #1
Posted on May 17, 2015 by Unclear
About
Snack Break is a series of problems that I will be compiling and posting every Sunday! Each problem can be solved in 15 minutes or less, so I strongly encourage you to try to solve each one.
I think solving problems you have not encountered before is the best way to help train your ability to solve problems, an essential skill for any programmer. Hopefully you will find these problems useful!
You can find a copy of the first Snack Break problem here on github by selecting the 2015 folder and then selecting 1_May17_Fizzbuzz.lua.
The github repository will serve as an archive of every problem posted so far, so if you missed a week or look at a past problem you can always visit it.
This week's problem
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz” instead. If the number is not divisible by either number, print out the number.
A solution and a new problem will be posted next week!
Commentary
Leave a Comment