0
What is the output of the following C program?
#include <stdio.h>
int f(int n) {
if (n <= 1) return 1;
return f(n - 1) + f(n - 2) + 1;
}
int main() {
printf("%d", f(5));
return 0;
}- A8
- B13
- C15
- D21
Correct answer: C
What is the output of the following C program?
#include <stdio.h>
int f(int n) {
if (n <= 1) return 1;
return f(n - 1) + f(n - 2) + 1;
}
int main() {
printf("%d", f(5));
return 0;
}