Examveda

Which code snippet correctly shows a for loop using a range to display "1 2 3 4 5 6"?

A. for(z in 1..7) println("$z ")

B. for(z in 1..6) print("$z ")

C. for(z in 1 to 6) print("$z ")

D. for(z in 1..7) print("$z ")

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.