
dragonmouthforge
969
15
4

A program that takes the numbers 1 - 100 if it’s a multiple of 3 it prints “Fizz” if it’s a multiple of 5 it prints “Buzz” If the number is a multiple of BOTH it prints “FizzBuzz” if none it prints the number.

Example of the output.
RonErez
Nice. I actually created an app that implements FizzBuzz in several programming languages, i.e. Swift, Go, Rust, C, etc.
ThatSonOfaBitch
3 things everyone should know to some degree: (1) weld, (2) build electronics, (3) code. With these skills you can do almost anything.
whiskinputwarbles
Nice! Learning programming is so much fun.
invaderjak
Not enough lines of code. Elon would fire you
Hekatombe
Someone else already made the Enterprise version of Fizzbuzz https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
invaderjak
I’m going to need this in PHP
iambrokencog
It's interesting to see how litmus tests become passe. In this case, the test was to determine if a person understood modulo operations.
iambrokencog
In a language which abstracts that to a boolean test, nothing is learned, except the interviewer doesn't know what they are testing.
dragonmouthforge
This was in the first week of learning Swift.
Everfearful
Is the "real" version expecting you to look for a modulus of 0 from 3 and 5?
iambrokencog
Well, how modulus works and demonstrate it at any rate.
Everfearful
I see...the concept is trivial to me but terminology isnt, so depending on the wording I may or may not stare at you blankly in response.