Advertisement
Archangelpl

Untitled

Sep 9th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. double f(int x, int n)
  4. {
  5. if (n == 1)
  6. {
  7. return x;
  8. }
  9. return(f(x,n - 1)*(-(n-1)*x)/n);
  10. }
  11.  
  12. int main()
  13. {
  14. double x,s=0;
  15.  
  16. for (int i = 0; i < 5; i++)
  17. s+= f(1, i+1);
  18. printf("%lf", s);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement