title: Rand() returns same or very similar output values
body: <p>C++ question here, using Code::Blocks.
  I'm trying to run this code to test the pseudo-random function</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;ctime&gt;
  
  using namespace std;
  
  int main()
  {
      int count = 0;
      while (count &lt; 10){
          srand(time(NULL));
          cout &lt;&lt; rand() &lt;&lt; ' ';
          cout &lt;&lt; (time( NULL )) &lt;&lt; " \n";
          count++;
      }
      return 0;
  }
  </code></pre>
  
  <p>The output from this is 10 equal lines. This is not really the problem, as the seed here is  the same, so the result should be the same. The problem is that if I run this program again it gives 10 very similar lines with little variation not only on the time() output, but on the rand output too.</p>
  
  <p>The srand(time(NULL)) is giving very similar answers that are basically the same return value, only a little bigger.</p>
  
  <p>(Returning 9631 on first run, and then 9656 on the second).</p>
  
  <p>My question is, is that the expected behavior? And how can I get more different results like 38 on the first run, and 671 on the second?</p>