a) With reference to the following routine, explain what is meant by the programming term recursion.


int Fibonacci (int n)


if (n == 0)

return 0;

else if (n == 1) return 1;


return (Fibonacci(n-1) + Fibonacci(n-2)); }

b) Write an iterative version of the above program generating the first 20 numbers of the Fibonacci series.

Leave an answer

Sorry, you do not have permission to answer to this question .