I was reading something last night that reminded me of the below puzzle which is more about problem solving that writing code.
How long does it take you to do the following?
Write some code to write the whole numbers from 1 to 100
for the multiples of 3 instead of the number write "Duck"
for the multiples of 5 instead of the number write "Sauce"
for the multiples of 15 instead of the number write "DuckSauce"
Writing to the immediate window is fine
It's got to be less than 50 lines of code (you can't just write all the numbers to 100 )
It isn't a trick question, but the crux of it is that you've got to try doing it on paper, rather than in the VBA editor - so you can't do loads of trial and error! Stretch your brain on a Friday!
Pseudo code is fine too if you fancy having a go but your VBA isn't the strongest
You may know this exercise by another name and have a solution, if so wait a while before posting your answer - give people a chance to have a go.
Once people have had a go, we'll see if anyone has a really nifty solution
Bookmarks