Skip to content

marciopmm/Fibonacci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fibonacci

A simple resolution to a common algorithm excercise.

The problem

Print to the console the "FIBONACCI SEQUENCE", a sequence of numbers beginning with 0 and 1, beeing the next one the sum of the two predecessors. The number passed as parameter is the amount of iteractions the list should have.

Example: for a list that should have 8 iteractions,
0
1
1
2
3
5
8
13
21
34
55

The solution

We use two examples of solution:

  • one by making a for loop and making the sum of the two predecessor numbers;
  • other by making a recursive loop, making the sum by calling the same function passing the two predecessor numbers.

Check the code to verify my answer. This are made for academic and training purposes only.

About

A simple resolution to a common algorithm excercise: the Fibonacci Sequence!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages