how to fill a matrix, with random numbers between 1 and the other parameter chosen by the user: exp: between 1 and 30 | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

how to fill a matrix, with random numbers between 1 and the other parameter chosen by the user: exp: between 1 and 30

18th Dec 2017, 4:53 PM
Anthony
1 Réponse
0
(int)(Math.random()*userInput)+1; this will give a random integer between 1 and whatever the user entered.
18th Dec 2017, 5:09 PM
Jeremy
Jeremy - avatar