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

Join The Discussion