title: rand() always returns the same sequence on application restart
body: <p>I have the following method which generates a random number:</p>
  
  <pre><code>int random_number() //Random number generator
  {
      int x = rand() % 1000000 + 1; //Generate an integer between 1 and 1000000
      return x;
  }
  </code></pre>
  
  <p>The call to this method is used in a loop which iterates five times.  The problem with this method is that it always seems to generate the same numbers when running the program several times.  How can this be solved?</p>