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
Syket Bhattachergee -
Nozibul Islam -
Muhammad Hassan -
MD ARIFUL HAQUE -
Top comments (0)