title: how do I fix this code
body: <p>I am taking an online course.</p>
  
  <p>The homework question is:</p>
  
  <blockquote>
    <p>Use the rand() function to print the first 50 numbers between 1 and 100. Try to put every 5 random number in one line only. Use setw() function to align.</p>
  </blockquote>
  
  <p>I currently have the following. I know that it is an infinite loop and the error I think the problem is in my <code>if</code> statement.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;time.h&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  int main() {
      int random_number;
  
      srand(time(NULL));
  
      random_number = rand() % 100 + 1;
      cout &lt;&lt; "50 random numbers are:" &lt;&lt; endl;
      while (random_number &lt; 100, rand() % 100 + 1)
      {
          cout &lt;&lt; random_number &lt;&lt; setw(5) &lt;&lt; endl;
          if (random_number == 100)
              break;
      }
      system("pause");
  }
  </code></pre>