Advertisement
noor017

S Sequence

Jun 9th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6.     double i, sum=0;
  7.  
  8.     for(i=1;i<=100;i++)
  9.     {
  10.         sum = sum + ( 1 / i);
  11.     }
  12.  
  13.     printf("S = %.2f\n", sum);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement