title: How to generate different random numbers in a loop in C++?
body: <p>Is it possible to generate different random number, every time loop runs. For example, i have:</p>
  
  <pre><code>for (int t=0;t&lt;10;t++)
  {
      int random_x;
      srand ( time(NULL) );
      random_x = rand() % 100;
      cout&lt;&lt;"\nRandom X = "&lt;&lt;random_x;
  } 
  </code></pre>
  
  <p>But the problem is, it generates same random number everytime. Is it possible to generate different random numbers everytime loop runs?</p>
  
  <p>IS there any possibility to reset random number initiallization as well?</p>