For instance max = 50 and min = 1 I want to find a random number from 48 to 5 what would the code be?
I wrote the part on how to find a random number from a smaller no. To a larger one.
Int r = nextInt(max - min + 1) + min
But I’m confused as to how to do it the other way around
I tried substituting and adding the max min around but the result I want did not appear
Aucun commentaire:
Enregistrer un commentaire