title: sum of series in c++ using if Conditional
body: <p>am trying to solve the equation in c++ sum of series  and am getting the right result
  but I just trying to use the if statement to get the same answer of this equation</p>
  <p>but always am getting struggling with it</p>
  <pre><code># include &lt;math.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
      int main()
      {
          double x = 1;
          double som = 0;
      
          double lim_nbr = pow(10.0, -6);
          int n = 1;
          do{
              x = 1.0 / ((n*n*4.0 - 1) * n);
              som += x;
              n+=1;
          }while (x &gt;= lim_nbr);
          double correctSum = 2.0*log(2.0) -1.0 ;
          cout &lt;&lt; &quot;Sum = &quot; &lt;&lt; som  &lt;&lt; endl;
          cout &lt;&lt; &quot;Sumcorrect = &quot; &lt;&lt; correctSum &lt;&lt; endl;
      }
  </code></pre>