MathWorks Interview Question

give the pseudo code for fibonacci numbers.

Interview Answer

Anonymous

May 14, 2011

int fibonacci (int n) { if (n==1||n==2) return 1; else if(n>2) return fibonacci(n-1)+fibonacci(n-2); else throw new exception(); }

2