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.")
}
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
Related Questions on Kotlin Program
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.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP
Join The Discussion