Random Number Generator in C [duplicate]
问题 This question already has answers here : Pseudo-random number generator (10 answers) Closed 6 years ago . I'm trying to generate a random number 0 - 59, and am not satisfied with the rand() function in C. Here is the code I'm playing around with: #include <stdlib.h> #include <time.h> main() { int num; srand(time(NULL)); num = rand(); num = num % 59; printf("%d\n", num); } I've repeated the run on this code and noticed that the random numbers being generated don't really seem that random. The