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