Skip to content

Fibonacci Sequence using For Loop, Recursive Function and Golden Ratio

License

Notifications You must be signed in to change notification settings

mcleber/Fibonacci_Sequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

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

Math is Fun: Fibonacci Sequence

About

Fibonacci Sequence using For Loop, Recursive Function and Golden Ratio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages