how to write a function in kotlin
// Use 'fun' keyword to declare function // 'num' is the parameter and is of type Int // The ':Int' indicates the return type fun square(num: Int):Int { return num * num }
Kotlin Function Example
fun main() { println("Hello, world!!!") x() } fun x(){ println("HELLO WORLD") }
function in kotlin
kotlin function