title: How to print this table in combined form C++?
body: <p>I need to print this table  </p>
  
  <p>2<br>
  0<br>
  4 2<br>
  3 3<br>
  6 4 2<br>
  6 6 6<br>
  8 6 4 2<br>
  9 9 9 9  </p>
  
  <p>I have written this code for the following result</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
      const int N = 9; 
      for(int i = 0; i &lt;= N; i += 3){   
          for (int j = 0; j &lt;= i; j +=3) {
              cout &lt;&lt; i &lt;&lt; " ";  
          }       
          cout &lt;&lt; endl; 
      }
      cout &lt;&lt; "\n";
      for(int i = 2; i &lt;= N; i += 2){    
          for (int j = i; j &gt; 0; j -= 2) {
              cout &lt;&lt; j  &lt;&lt; " ";    
          }         
          cout &lt;&lt; endl; 
      }
      return 0;
  }
  </code></pre>
  
  <p>My Result:  </p>
  
  <p>0<br>
  3 3<br>
  6 6 6<br>
  9 9 9 9  </p>
  
  <p>2<br>
  4 2<br>
  6 4 2<br>
  8 6 4 2   </p>
  
  <p>Required Result:  </p>
  
  <p>2<br>
  0<br>
  4 2<br>
  3 3<br>
  6 4 2<br>
  6 6 6<br>
  8 6 4 2<br>
  9 9 9 9</p>