title: C - Find all amicable numbers between limits
body: <p>First a definition: An amicable pair of numbers consists of two different integers where the
  sum of the divisors of the first integer is equal to the second integer, and the
  sum of the divisors of the second integer is equal to the first integer. A perfect number is a number that equals the sum of its own divisors.</p>
  
  <p>What I want to do is make a program that asks the user for a lower limit, and an upper limit and then presents him/her with all the amicable pairs (one per line) between those two limits. If there's a perfect number only one number needs to be printed (not a pair in its case).</p>
  
  <p>The whole idea is pretty confusing to me, so I'm looking for some assistance.</p>
  
  <p>Here's what I have to start with, I know that sumDivisors() should be more or less correct, but main() is merely checking if the two inputted numbers are amicable or not - might have to do a complete overhaul of this since I want all the pairs between two given limits.</p>
  
  <pre><code>long sumDivisors(long a)
  {
      long s=0,i;
      for(i=1;i&lt;=a/2;i++)
      {
          if(a%i==0)
          {
              s+=i;
          }
      }
      return s;
  }
  
  
  int main()
  {
      long t,n,s1;
      scanf("%ld",&amp;t);
      while(t--)
      {
          scanf("%ld",&amp;n);
          s1=sumDivisors(n);
          if(n==sumDivisors(s1))
          {
              printf("Yes\n");
          }
          else printf("No\n");
      }
      return 0;
  } 
  </code></pre>