Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- double f(int x, int n)
- {
- if (n == 1)
- {
- return x;
- }
- return(f(x,n - 1)*(-(n-1)*x)/n);
- }
- int main()
- {
- double x,s=0;
- for (int i = 0; i < 5; i++)
- s+= f(1, i+1);
- printf("%lf", s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement