Hello,
I wrote a code to calculate the fibonacci number. However, i noticed that it starts acting erratic when i input 1000 i.e it cannot calculate the 1000th fibonacci number.
I would appreciate it if you could show me how to make it work.
int f(int &n)
{
if ((n == 2) || (n == 1))
return(1);
else
return(f(n-1) + f(n-2));
}
thank you in advance for your help