1 votes 1 votes let f(1)=1+(1/1) , f(2)= 1+(1/(1+(1/2))) , f(3)=1+(1/(1+(1/(1+(1/3))))) write a program in c which reads n and prints f(n)? Programming in C programming-in-c + – AIkiran01 asked Jun 14, 2017 retagged May 20, 2021 by Shiva Sagar Rao AIkiran01 384 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes this program can be done easily by using concept of recursion: int n; void main() { scanf("%d",&n); result=s(1); } series( int i) { if (i==n) return n; else return (1+(1/s(++i))); } recursion tree is as shown below: Niraj Singh 2 answered Jun 20, 2017 Niraj Singh 2 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes sum = N; for(int i=0;i<N;i++ { sum = 1/sum; sum = 1+sum; } Aghori answered Jun 14, 2017 Aghori comment Share Follow See 1 comment See all 1 1 comment reply AIkiran01 commented Jun 15, 2017 reply Follow Share This is incortect i tried a lot... but nothing much is working out 0 votes 0 votes Please log in or register to add a comment.