Skip to content

Commit e5e4c14

Browse files
committed
fibonacci
1 parent 9caff79 commit e5e4c14

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Programs/Basic/fibonaaci.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
4+
/*
5+
WAP Fibonaci nth number
6+
*/
7+
function fibo(n) {
8+
9+
if (n==0||n==1) {
10+
11+
return n
12+
} else{
13+
14+
return fibo(n-1)+fibo(n-2)
15+
}
16+
17+
}
18+
console.log(fibo(6))//8
19+

0 commit comments

Comments
 (0)