title: Star Pattern Logic
body: <p>I want make a star pattern just like this.</p>
  
  <pre><code>    *
    * * *
  * * * * *
    * * *
      *
  </code></pre>
  
  <p>I am using this code.</p>
  
  <pre><code>for (int i=1; i&lt;=3; i++) {
          for (int j=1; j&lt;=3-i; j++) {
              printf(" ");
          }
          for (int k=1; k&lt;=2*i-1; k++) {
              printf("x");
          }
          printf("\n");
      }
  </code></pre>
  
  <p>This will give </p>
  
  <pre><code>     *
     * * *
   * * * * *
  </code></pre>
  
  <p>How I will iterate in decrement order.    </p>
  
  <pre><code> when I am using 
  for (int i=3; i&gt;=0; i--) {
          for (int j=1; j&lt;=3-i; j++) {
              printf(" ");
          }
          for (int k=1; k&lt;=2*i-1; k++) {
              printf("x");
          }
          printf("\n");
      }
  
  xxxxx
   xxx
    x
  </code></pre>
  
  <p>How we merged it?</p>