Even numbers with steps

Report a typo

We have a program that prints all even numbers in the range from 1 to 20 inclusive, using a step size of 3. Use the correct operators so that the program prints:

4
10
16
Fill in the gaps with the relevant elements
fun main() {
    for (i in 120 step 3) {
        if (i % 2 == 0) {
            println(i)
        }
    }
}
to...in..<=
___

Create a free account to access the full topic