Domanda di colloquio di Imagine Communications

Fizz buzz coding question. Was also asked to solve without using modulus