title: Printing a "triangle" of asterisks
body: <p>The program I am supposed to write is supposed to print the triangle in the following manner:</p>
  
  <p>If the number of rows is 2:</p>
  
  <pre><code>       *
        ***
  </code></pre>
  
  <p>If the number of rows is 3:</p>
  
  <pre><code>     *
      * *
     *****
  </code></pre>
  
  <p>However, the following code that I did prints the correct amount of stars for the last line, but I am not so sure how I would print the space and the newline. My code for printing the bottom level stars is the following:</p>
  
  <pre><code>  void tri_func(num)
  {
  
       int row; int c=1;
       int j;
  
     for ( row = 1 ; row &lt;= num ; row++ )
     {
        for (j=1; j &lt; row-2; j++) printf(" ");
        for ( c = 1 ; c &lt;= (2*row )- 1-j ; c++ )
        {
          printf("*");
        }
  
        printf("\n");
     }
  }
  </code></pre>