title: Why does rand() always return the same value?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3067364/generating-random-numbers-in-c">Generating random numbers in C</a><br>
    <a href="https://stackoverflow.com/questions/3159644/using-rand-to-generate-a-random-numbers">using rand to generate a random numbers</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to generate random numbers but i'm constantly getting the number 41.
  What might be going so wrong in such a simple snippet?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(void)
  {
      int a = rand();
      printf("%d",a);
      return 0;
  }
  </code></pre>
  
  <p>Thanks for help.</p>