vendredi 5 juin 2020

How to get random 100 numbers in Kotlin

This is the code that I used for this task:

import kotlin.random.Random

fun main(args:Array<String>) {

val randomnum = List(100) { Random.nextInt(0, 100)}
println(randomnum)

}

Can you help me get some other methods to get the same output as this code?

Thank you in advance,




Aucun commentaire:

Enregistrer un commentaire