4 ms·
No, in that case the first two conditionals will both pass and the result will end up as "FizzBuzz".
by extension 15y ago
No, in that case the first two conditionals will both pass and the result will end up as "FizzBuzz".
- denzil_correa 15y agoWell, that would depend on the print statement. Generally, all of them have new lines. Even if they don't you would have to generate new lines appropriately otherwise the next number would print right next to Fizz. PS : My assumption is that you need to print each number or Fizz or Buzz or FizzBuzz in a separate line.
- splatterdash 15y agoWell, you can check for 3 AND 5 first (or check for 15 altogether). This is if you have two subsequent checks for 3 and for 5.