title: What is the best way / approach to printing this specific triangle pattern in C?
body: <p>The goal is to print this when calling <code>printTriangle(7);</code>:</p>
  <pre><code>      +
       ++
      +-+
     +--+
    +---+
   +----+
  +++++++
  </code></pre>
  <p>Here is my method so far:</p>
  <pre><code>int printTriangle(int height)
  {
      int x, i, j, space;
      space = height-1;
      for(x=0; x&lt;=height; x++)
      {
          for(j=0; j&lt;=space; j++)
          {
              printf(&quot; &quot;);
          }
          space--;
          for(i=0; i&lt;x; i++)
          {
              printf(&quot;+&quot;);
          }
          printf(&quot;\n&quot;);
      }
      return 0;
  }
  </code></pre>
  <p>It prints this:</p>
  <pre><code>      +
       ++
      +++
     ++++
    +++++
   ++++++
  +++++++
  </code></pre>
  <p>I can't seem to find a way to get the conditionals right for the inner triangle of &quot;-&quot;s, anyone can lead me in the right direction?</p>