title: C programming help - adding values together/for loop
body: <p>I'm trying to add values together that I get using a for loop but I'm stumped as to how to do it.  This is the code I have so far:</p>
  
  <pre><code>    float counter;
      float harmonic;
      float sum;
  
      for (counter = 2; counter &lt;= n; counter ++)
      {
          harmonic = 1/counter; // current value
          sum = harmonic; // stores current value                          
      }
  
      return 0;
  }
  </code></pre>
  
  <p>So basically for each value I get for the "harmonic" variable I need to add it to the next until the loop ends.  Should I be looking at arrays?  Thanks for any help.</p>