Kotlin - Loops and Ranges
What will be the output of this Kotlin code?
for (i in 1..5) {
if (i == 3) break
print(i)
}for (i in 1..5) {
if (i == 3) break
print(i)
}i equals 3, break stops the loop immediately.i == 3, then loop stops.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions