![]() |
rand() help trying to loop it till it finds all numbers in range 4x
what code can i use to make a loop that will find random numbers in the rang of 1 - 13 till all numbers in that range are used 4 times
this is what i would use to just make a loop that finds random numbers for (int x; x <= 52; x++) // loop till x = 52 { srand((unsigned)time(NULL)); // seed rand y += 1 + rand() % (13); //find a random number in the rang of 1 - 13 cout << y << endl; // display random number } |
Re: rand() help trying to loop it till it finds all numbers in range 4x
Here's one way:
Code:
void test30() |
| All times are GMT +5.5. The time now is 16:49. |