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
16We 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
16fun main() {
for (i in 120 step 3) {
if (i % 2 == 0) {
println(i)
}
}
}Create a free account to access the full topic