@FarzanaAlya/

DeterminedInformalEvent

Kotlin (beta)

No description

fork
loading
main.kt
1
2
3
4
5
6
7
8
9
10
11
12
fun main(args: Array<String>) {
    val number = 20
    val sum =  addNumbers(number)
    println("Sum = $sum")
}

fun addNumbers(num: Int): Int {
    if (num != 0)
        return num + addNumbers(num - 1)
    else
        return num
}
Welcome to Kotlin version 1.0.3