title: When I run the program, the output is "inf"
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
      
  int main() {
      float sum = 0;
      int n;
      cout &lt;&lt; &quot;Nhap gia tri n = &quot;;
      cin &gt;&gt; n;
      for (int i = 0; i &lt;= n; i++) {
          sum += 1 * 1.0f / i;
      }
      cout &lt;&lt; &quot;Tong la: &quot; &lt;&lt; sum &lt;&lt; endl;        
      return 0;
  }
  </code></pre>