Kotlin - Loops and Ranges
What will be the output of this Kotlin code?
var count = 3
while (count > 0) {
println(count)
count--
}var count = 3
while (count > 0) {
println(count)
count--
}count starts at 3. The loop runs while count > 0, so it runs for 3, 2, and 1.count then decreases it by 1. So it prints 3, then 2, then 1, then stops before printing 0.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions