Fizz Buzz

Report a typo

Fizz Buzz is a classic programming problem. Here is its slightly modified version.

Write a program that takes the input of two integers: the beginning and the end of the interval (both numbers belong to the interval).

The program is to output the numbers from this interval, but if the number is divisible by 3, you should output Fizz instead of it; if the number is divisible by 5, output Buzz, and if it is divisible both by 3 and by 5, output FizzBuzz.

Output each number or word on a separate line.

Sample Input 1:

8
16

Sample Output 1:

8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
Write a program in Kotlin
fun main() {
// put your code here
}
___

Create a free account to access the full topic