Print First n numbers in Fibonacci Series

Objective: Write a program to print first n numbers in Fibonacci series.

Fibonacci number: First two Fibonacci numbers are defined as 0 and 1 and every number after the first two is the sum of the two preceding ones

Fibonacci Sequence- 0 1 1 2 3 5 8 13 21 34 55 89 ……..

Code:

Output:

First 10 elements in fibonacci series are:
0 1 1 2 3 5 8 13 21 34

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.