belongs to collection: Kotlin programming Exercises
Write a Kotlin program to create an array of size 10 containing
0 2 4 6 8 10 12 14 16 18
Solution:
fun main(args : Array<String>) { val x = Array(10) { i -> i * 2 } for(s in x){ println(s); } }
Output:
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Solution:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer