title: Random Number Generator in C
body: <p>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:</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  main()
  {
  
  int num;
  srand(time(NULL));
  num = rand();
  num = num % 59;
  printf("%d\n", num);
  }
  </code></pre>
  
  <p>I've repeated the run on this code and noticed that the random numbers being generated don't really seem that random. The generated numbers produced are definitely following a pattern, as each time I run the program the number gets progressively larger until it wraps back around to the beginning (i.e. 2, 17, 21, 29, 38, 47, 54, 59, 4, 11....etc).</p>
  
  <p>Is there a way I can seed the function so that every time I re-run the function I get a true random number with a 1/60 chance of being generated? Or are there any alternative methods I can implement myself rather than using the rand() function in C? </p>