Hello, my name is Igor and I'm a student. In the near future, we will have our exams, and I'm preparing for them right now. The issue I have is some of the problems that we have to practice are hard to solve, so I'm asking you to help me solve it.
This is the problem that I have to solve.
This is my code:
Code:
double recursion(int n, int k)
{
if(n == 0)
return ;
if(k == 1)
return sqrt(k/n+recursion(n--, k++));
else
return sqrt(k/n+recursion(n--, k--));
}
int main()
{
int n;
scanf("%d", &n);
printf("%f", recursion(n, 1));
return 0;
}
I think I'm having a problem with the first part of my recursion function. I think I'm very close to solving it. Thanks for reading this and please help if you can!