๐Ÿ‘‰๐Ÿ‘‰๐Ÿ‘‰Challenge๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿ‘ˆ (Fibonacci numbers) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

๐Ÿ‘‰๐Ÿ‘‰๐Ÿ‘‰Challenge๐Ÿ‘ˆ๐Ÿ‘ˆ๐Ÿ‘ˆ (Fibonacci numbers)

Given the position of the Fibonacci number, make a function(can be recursive) and calculate the number. here is the series: 1 1 2 3 5 8 13... Example: Input: 6 output: 8 Have fun. If you like this challenge tell your friends and give an upvote.

28th Nov 2017, 7:50 AM
Cat๐Ÿˆ
Cat๐Ÿˆ - avatar
14 Answers
28th Nov 2017, 2:46 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 34
thnks 4 marking my answer best ... yeah โ˜บ
29th Nov 2017, 10:16 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 14
https://code.sololearn.com/caP8649IZ2fH/?ref=app it can calculate up to 141th number
12th Apr 2018, 6:17 AM
AliRเซฏza
AliRเซฏza - avatar
28th Nov 2017, 10:51 AM
Justine Ogaraku
Justine Ogaraku - avatar
+ 5
(javascript) var fibonacci = function(n){ return Math.round(Math.pow((1+Math.sqrt(5))/2,n)/Math.sqrt(5)); }
10th Dec 2017, 11:02 PM
Dapper Mink
Dapper Mink - avatar
28th Nov 2017, 8:33 AM
blackcat1111
blackcat1111 - avatar
+ 4
Technically that's not recursive, just using a for loop and an array. ๐Ÿ˜‰
28th Nov 2017, 8:38 AM
blackcat1111
blackcat1111 - avatar
+ 4
https://code.sololearn.com/c5tk30L15s4w/?ref=app
28th Nov 2017, 9:49 AM
DAB
DAB - avatar
+ 3
i sort of used that too. I used recursive functions ๐Ÿค—
28th Nov 2017, 8:35 AM
Cat๐Ÿˆ
Cat๐Ÿˆ - avatar
+ 3
@ Gaurav Agrawal you're welcome ๐Ÿ˜‹
29th Nov 2017, 10:19 AM
Cat๐Ÿˆ
Cat๐Ÿˆ - avatar
28th Nov 2017, 8:46 AM
Cat๐Ÿˆ
Cat๐Ÿˆ - avatar
28th Nov 2017, 11:14 PM
Aref moloughi
Aref moloughi - avatar
0
https://code.sololearn.com/cFSrGw3QKTa1/?ref=app
26th May 2018, 10:24 AM
Shuaib Nuruddin
Shuaib Nuruddin - avatar