title: Don't include a comma after the last item in a printed list
body: <p>I have a list of numbers that are printed:</p>
  
  <p>1: 1,<br>
  2: 1, 2,<br>
  3: 1, 3,</p>
  
  <p>How do I not include that last comma on each line?</p>
  
  <pre><code>for ( int i = 1; i &lt;= x; ++i )
    {
      cout &lt;&lt; i &lt;&lt; ": ";
      for ( int j = 1; j &lt;= i; ++j )
      {
        if ( i % j == 0 )
        {
          cout &lt;&lt; j &lt;&lt; ", ";
        }
      }
      cout &lt;&lt; endl;
    }
  </code></pre>