You are on page 1of 4

Name: Saba Arbab

Course: ADP_CS
Assignment: Fibonacci numbers for looping.
Example of fibonacci series
Submitted by: Saba Arbab
Submitted to: Prof. Shahbaz
Fibonacci Series in C++
Fibonacci Series in C++: In case of fibonacci series, next number is the
sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21 etc.
The first two numbers of fibonacci series are 0 and 1.

How do you make a Fibonacci sequence in C++


We can create the Fibonacci sequence in C++ using various
approaches such as recursion, loops, matrix multiplication, etc.
If they are space constraints, the Fibonacci sequence can be
generated using recursion with memoization or using the matrix
multiplication technique. In recursion, we can provide a base
case and build the solution upwards

Working of fibonacci in C++


Fibonacci Series is in the form of 0, 1, 1, 2, 3, 5, 8, 13, 21,......
To find this series we add two previous terms/digits and get
next term/number.
C++ program using For loop to print fibonacci series
Another Example to get output as fibonacci series using
while loop:

You might also like