Modify a program below to output the first 5 Fibonacci numbers, each on a new line.
Introduction to functions
Fibonacci sequence
Report a typo
Write a program in Scala 3
@main def fibonacci = {
val a = 0
val b = 1
def sum(a: Int, b: Int): Int = ???
println(a)
println(b)
println(sum(a, b))
println(sum(???))
println(sum(sum(???), ???))
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.