Advertisement
Mary_99

ex2.2

Nov 22nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <math.h>
  4. int main()
  5. {
  6.     float n = 1;
  7.     float sum;
  8.      do
  9.      {
  10.         sum = 1 / (n * (n + 1));
  11.         printf("%f", sum);
  12.         n ++;
  13.      }
  14.      while (sum>0.0001);
  15.  
  16.  
  17.  
  18.  
  19.    return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement