kotlin while example
Example 1: kotlin while
var i = 1
while (i < 5) { // while loop
println(i)
i++
}
var i = 1
do { // do-while loop
println(i)
i++
} while (i < 5)
Example 2: while loop kotlin
for (item in collection) print(item)