We've wrritten this code:
def mainFunction(): Unit = {
println("Hello AlgoCademy!")
println("Coding is amazing!")
println("Functions are so useful!")
println("Hello AlgoCademy!")
println("Coding is amazing!")
println("Functions are so useful!")
println("Hello AlgoCademy!")
println("Coding is amazing!")
println("Functions are so useful!")
}
Write the same code in a better way by creating and calling a function printMessages()
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check