title: Using a nested for loop to count up and down
body: <p>I was able to make a counter that goes up but what about down? Overall I want it to go like so:</p>
  
  <pre><code>1
  12
  123
  1234
  12345
  12345
  1234
  123
  12
  1
  </code></pre>
  
  <p>The code above you is the end result I want. But I cant seem to get the nested for loop to work for counting down.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  int main()
  {
      int row, col;
      int size;
      int mych;
  
      int printch = 1;
  
      cout &lt;&lt; "Size of Shapes (&gt;0) ";
      cin &gt;&gt; size;
  
      while (size&lt;0)
      {   
          cout &lt;&lt; "\nSize of Shapes (&gt;0) ";
          cin &gt;&gt; size;
      }
  
      cout &lt;&lt; "Characters to use: ";
      cin &gt;&gt; mych;
  
      for(row = 1; row &lt;= size; row++)
      {
          printch = mych;
          cout &lt;&lt; "\n" &lt;&lt; setw(8);
  
          for(col = 1; col &lt;=row; col++)
          {
              cout &lt;&lt; printch;
              printch++;
          }
      }
  
      for(row = size ; row &lt;= size; row++)
      {
          printch = mych;
          cout &lt;&lt; "\n" &lt;&lt; setw(8);
  
          for(col = mych; col &lt;=row; col++)
          {
              cout &lt;&lt; printch;
              printch++;
          }
      }
      cout &lt;&lt; "\n\n";
  
      system ("pause");
  
      return 0;
  }
  </code></pre>
  
  <p>I'm stumped on this question. Any help would be appreciated!</p>