title: Write a program in C++ that sums a simple series: 1/N + 2/N-1 + 3/N-2+ … N/1
body: <p>I have been tasked to write a program that computes the series mentioned in the title. Everything seems to work just fine in the program, but the equation is wrong.   </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
    double n;
    double sum = 0;
  
    cout &lt;&lt; "Enter a number: ";
    cin &gt;&gt; n;
  
    for (double i = 1; i &lt;= n; i++)
    {
      sum = (1 / i) + (2 / i - 1) + (3 / i - 2);
    }
  
    cout &lt;&lt; "Sum is: " &lt;&lt; sum &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>Any help would be appreciated. Thanks!</p>