Complete the code to print a greeting in Kotlin.
fun main() {
println([1])
}In Kotlin, println prints text to the screen. The text must be inside quotes.
Complete the code to declare a variable holding the number 10.
fun main() {
val number: Int = [1]
println(number)
}In Kotlin, numbers are written without quotes. Quotes make them text.
Fix the error in the function declaration by completing the blank.
fun greet() : [1] { return "Hello" }
Unit or void which mean no return value.Int which is for numbers.The function returns a text string, so its return type must be String.
Fill both blanks to create a list of numbers from 1 to 5.
fun main() {
val numbers = listOf([1], [2], 3, 4, 5)
println(numbers)
}The list holds numbers, so use numbers without quotes.
Fill all three blanks to create a function that adds two numbers and returns the result.
fun add([1]: Int, [2]: Int) : [3] { return a + b }
String as return type instead of Int.The function parameters are two integers named a and b, and it returns an integer.
