✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the value returned by f(3)
?
int f(int x, int &c) {
c++;
if (x <= 1) return x;
else return f(x - 1, c) + f(x - 2, c);
}
int f(int n) {
int c = 0;
int r = f(n, c);
return r + c;
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!