Decrement in loops

Report a typo

What does this code print?

var number = 5

repeat(2) {
    number--
}

repeat(0) {
    number--
}

repeat(1) {
    number--
}

println(number)

Enter a number.

Enter a number
___

Create a free account to access the full topic