title: Finding the total number combinations for an integer using three numbers
body: <p>For a given integer, <em>n</em>, I need to print all the lists of length 3 which sum to <em>n</em>. The members of the list must be non-negative integers. After printing all these lists, it must then print the number of lists that were found.</p>
  
  <p>For example, if <em>n=2</em>:</p>
  
  <ul>
  <li>1+0+1  = 2</li>
  <li>1+1+0  = 2</li>
  <li>0+1+1  = 2</li>
  <li>2+0+0  = 2</li>
  <li>0+0+2  = 2</li>
  <li>0+2+0  = 2</li>
  </ul>
  
  <p>Here is the program I did for lists of length 2 rather than lists of length 3:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main (void)
  {
      int total;
      int c1=0;
      int c2=0;
      int c3=0;
      int count;
  
      printf("Welcome friends and mainly enemies to the thingy. Only postive intergers!!!\n That's right just enter a number here:");
      scanf ("%d",&amp;total);
      printf ("\n\n\nWhy pick %d? Here is the list if combinations anyway,",total);
  
      for (count=0;count&lt;=total;count++)
      {
          printf ("\n");
          for (c1=count;c1==count;c1--)
          {
              printf("%d ",c1);
  
          }
          for (c2=total-count;c2&lt;=total-count;c2++)
          {
              printf("%d",c2);
  
          }
  
      }
      printf ("\n\nThere are %d number combinations that total %d",count,total);
  
  }
  </code></pre>
  
  <p>The goal is to extend this from lists of length two to lists of length 3.</p>
  
  <p>Additional Info: 
  I can only use one other variable c3.</p>