Kotlin - Loops and Ranges
What will be printed by this Kotlin code?
var total = 0
for (i in 2..6 step 2) {
total += i
}
println(total)var total = 0
for (i in 2..6 step 2) {
total += i
}
println(total)15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions