Examveda

How do you fill in the blank below to display all of the even numbers from 1 to 10 with least amount of code?
for (_____) {
  println("There are $count butterflies.")
}

A. count in 1..10

B. count in 2..10 step 2

C. count in 1..10 % 2

D. var count=2; count <= 10; count+=2

Answer: Option B


This Question Belongs to Computer Science >> Kotlin Program

Join The Discussion

Related Questions on Kotlin Program

What is Kotlin?

A. A new version of Java.

B. A JavaScript framework.

C. A statically-typed programming language for the JVM, Android, and browser.

D. A database management system.