function kotlin
snippet in kotlin

kotlin function

user1829

fun sum(a: Int, b: Int): Int {
 return a + b
}

function kotlin

user9885

// Declare a function in Kotlin
fun happyBirthday(name: String, age: Int): String {
    return "Happy ${age}th birthday, $name!"
}
// Call function
val greeting = happyBirthday("Anne", 32)