jeudi 16 avril 2020

Generate Random number with range [duplicate]

I want to generate random number from range (1 to n)

int num=rand.nextInt(10);

this generates from 0 to 9 but I want to start from 1




Aucun commentaire:

Enregistrer un commentaire