Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Fibonacci perticular position in javascript

function fibo(i) {
    if (i == 0) {
        return 0;
    }
    if (i == 1) {
        return 1;
    }
    return fibo(i - 1) + fibo(i - 2);
}
console.log(fibo(6));
//Output: 8 
 
PREVIOUS NEXT
Tagged: #Fibonacci #perticular #position #javascript
ADD COMMENT
Topic
Name
6+2 =