+ 1
What is fibonacci series...??
i want to know fibonacci series and hiw for loop does its looping on it... tell me logic and exicution please
2 Answers
+ 12
E.g. Fib sequence starting with 0, 1:
0, 1,
The next number is the sum of current number and the previous number:
0, 1, (0+1),
(which is 0, 1, 1)
Same thing for the next number in the sequence
0, 1, 1, 2
0, 1, 1, 2, 3
0, 1, 1, 2, 3, 5
0, 1, 1, 2, 3, 5, 8, ...
Sample code:
https://code.sololearn.com/cxpVnO0J3v5H/?ref=app
0
Check out my code:
https://code.sololearn.com/cRdvpVrWwP57/?ref=app