Fibonacci sequence

Report a typo

Modify the program below to output the first 20 Fibonacci numbers, each on a new line.

Write a program in Scala 3
def printNumber(???, ???, count: Int): Unit =
if (count > 0) {
println(???)
printNumber(???, ???, count - 1)
}


@main def fibonacci =
printNumber(0, 1, ???)
___

Create a free account to access the full topic