title: C++ Print inputed number in ascending order using do while loop
body: <p>Need to display this using <strong>do while loop</strong> in c++ and I'm stuck with my code. This is my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main ()
  {
      int mn, i, n = 1;
      cout &lt;&lt; "Enter max number: ";
      cin &gt;&gt; mn;
  
      do
      {
          cout &lt;&lt; n &lt;&lt; " ";
          n++;
      } while (mn &gt;= n);
      {
          cout &lt;&lt; endl;
          system("pause");
          return 0;
      }
  </code></pre>
  
  <p>My code only displays </p>
  
  <pre><code>    Enter max number: 8
      1 2 3 4 5  6 7 8
  </code></pre>
  
  <p>It supposed to display this, but I dont know how to make it work.</p>
  
  <pre><code>   Enter max number: 8
  
     1
     12
     123
     1234
     12345
     123456
     1234567
     12345678
  </code></pre>
  
  <p>Any ideas how to make it work? Thanks</p>