title: error: ‘n’ was not declared in this scope
body: <p>I wrote a function to find the sum of divisors for a number n. </p>
  
  <pre><code>int divisor_sum(long n) {
      long sum = 0;
      for (int a=1, a&lt;=n, a++) {
          if n % a == 0 {
              sum = sum + a;
          }
      }
      return sum;
  }
  </code></pre>
  
  <p>Unfortunately, the program (which includes a main function skeleton) won't compile because it says that "'n' was not declared in this scope." I've tried declaring n as a long before and after the function definition statement to no avail. How do I fix this?
  Thanks</p>