I'm very much familiar with the function rand and the seeded function srand. In my program i have initialized srand(1), and i do know that for rand()%((10)+1) will give me 10 randomly generated numbers which are the following (6,10,6,2,1,4,0,6,3,1). if i initialize number as number=rand()%((10)+1), then number equals 10, which is the first number from the list of randomly generated number. my question is how do i get the second value on the list (which is 10)? any help is very much appreciated.
Aucun commentaire:
Enregistrer un commentaire