title: Finding which Pythagorean triple has the smallest angle
body: <p>Information: <code>a</code> being the length of the shortest leg of a right triangle and <code>b</code> being the length of the other leg, the larger the difference between <code>a</code> and <code>b</code> the smaller the angle. That is:</p>
  
  <ul>
  <li>the triple (3, 4, 5) has a difference of 4-3=1</li>
  <li>the triple (5, 12, 13) has a difference of 12-5=7</li>
  </ul>
  
  <p>Therefore the smallest angle would be in the triple (5, 12, 13)</p>
  
  <p>I'm writing a program that compares all of the pythagorean triples defined in a range and prints the triple with the smallest angle.  What I have so far is not working and I have no idea where I can go from here.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int smallest(int a, int b) {
    int difference = b - a;
    return 0;
  }
  
  
  int main() {
  
   int a = 0, b = 0, c = 0, n, counter = 1, i = 0;
  
   printf("Please Enter a Positive Integer: \n");
   scanf("%d", &amp;n);
  
   for (c = 0; c &lt; n; c++) {
     for (b = 0; b &lt; c; b++) {
       for (a = 0; a &lt; b; a++) {
         if (a * a + b * b == c * c ) {
           printf("%d:\t%d %d %d\n", counter++, a, b, c);
         }
       }
     }
     i = counter - 1;
   }
   printf ("The difference is %d\n", smallest(a, b));
   printf ("There are %d Pythagorean Triples in this range.\n", i);
   return 0;
  }
  </code></pre>
  
  <p>The program just prints the difference is 0</p>
  
  <p>what I am looking for the program to print is, for the example above "The triangle with the smallest angle is (5, 12, 13)"</p>
  
  <p>I know I have to sort the differences and compare them but this is all I have so far, any tips?</p>