logo

Crowdly

Browser

Add to Chrome

What will be the output of the following recursive function? #include <stdio.h...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What will be the output of the following recursive function?

#include <stdio.h>

int fib(int n) {

    if (n <= 1) return n;

    return fib(n - 1) + fib(n - 2);

}

int main() {

    printf("%d", fib(5));

    return 0;

}

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on lms2.ai.saveetha.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome