Advertisement
Guest User

Untitled

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