Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 518 Bytes

README.md

File metadata and controls

17 lines (14 loc) · 518 Bytes

FizzBuzz Variation

Write a program that prints all the numbers from 1 to 100.

Rules

  • For multiples of 3, instead of the number, print "Fizz"
  • For multiples of 5 print "Buzz" .
  • For numbers which are multiples of both 3 and 5, print "FizzBuzz".

But here's the catch: you can use only one if. No multiple branches, ternary operators or else.

Requirements

  • Maximum of 1 if
  • You can't use else, else if or ternary
  • You can't use switch ... case
  • Unit tests
  • You have to use PHP.