0

# Write a program for Fibonacci number series.

2 Answers

+ 4

Use this function to generate nth fibonacci number.
int fibonacci(int n) {
if (n == 0 || n == 1)
return n;
else
return fibonacci(n - 2) + fibonacci(n - 1);
}

0

There is an error detected in the last line.ie.
undefined reference to 'fibonacci (int)'