The below code uses Binet's Algorithm to find the nth Fibonacci number.
int nthFibonacci(int n){
double phi= double(1+sqrt(5))/2;
return round(pow(phi,n)/sqrt(5));
}
The below code uses Binet's Algorithm to find the nth Fibonacci number.
int nthFibonacci(int n){
double phi= double(1+sqrt(5))/2;
return round(pow(phi,n)/sqrt(5));
}
For further actions, you may consider blocking this person and/or reporting abuse
Alessandro Pecorilla -
Wojciech Kaczmarczyk -
yayabobi -
Marvellous Francis -
Top comments (0)