https://github.com/mcleber/fibonacci_sequence
Fibonacci Sequence using For Loop, Recursive Function and Golden Ratio
https://github.com/mcleber/fibonacci_sequence
cpp fibonacci-sequence learning-cpp sourcecode
Last synced: 4 months ago
JSON representation
Fibonacci Sequence using For Loop, Recursive Function and Golden Ratio
- Host: GitHub
- URL: https://github.com/mcleber/fibonacci_sequence
- Owner: mcleber
- License: mit
- Created: 2022-10-15T03:09:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T05:54:54.000Z (over 1 year ago)
- Last Synced: 2025-01-12T15:46:18.682Z (5 months ago)
- Topics: cpp, fibonacci-sequence, learning-cpp, sourcecode
- Language: C++
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ Fibonacci Sequence
The Fibonacci numbers may be defined by the recurrence relation.
Fn = F(n-1) + F(n-2)
The first 10 Fibonacci numbers Fn are:
| n = | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Fn = | 0 | 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 |### Update 2023/08/06 - v.1.1:
- Added sequence calculation using recursive function;
- Added the header file cmath;
- Fixed system("CLS") to system("clear || cls");
- Source code organized by scope.### Run on Linux
``g++ FibonacciSequence.cpp -o FibonacciSequence````./FibonacciSequence``
### Sources
[Wikipedia: Fibonacci Number](https://en.wikipedia.org/wiki/Fibonacci_number)
[Math is Fun: Fibonacci Sequence](https://www.mathsisfun.com/numbers/fibonacci-sequence.html)