Kotlin by Example: While

fun main() {

Kotlin has while loops, which work as you would expect.

    var i = 1
    while (i < 100) {
        println(i)
        i *= 2
    }
}
$ kotlinc main.kt -include-runtime -d main.jar
$ java -jar Main.jar
1
2
4
8
16
32
64