First we must know whatÂ **Fibonacci series**Â is.

**0 1 1 2 3 5 8 13 21………..**

By definition, the first Fibonacci number is â€˜0â€™ and second Fibonacci number is â€˜1â€™. Then each subsequent number is calculated based on sum of the previous two. Numbers of Fibonacci sequence are known as Fibonacci numbers.

This sequence has many applications inÂ **mathematics**Â andÂ **Computer Science**.

Here in the program we have two initial values of series, ‘0’ and ‘1’ in variables ‘first’ and ‘sec’ respectfully.

Then user enters the Fibonacci number in variable ‘**n**‘.

WhenÂ **n>2**, the loop is executed, its value starts from 3 as two values are printed already.

In loop the sum of previous two numbers are stored in variable ‘sum’ then value of â€˜secâ€™ is saved in â€˜firstâ€™ and value of â€˜sumâ€™ is saved in â€˜secâ€™, at last the value of sum is printed. Further the loop is continued until the value of â€˜**i**â€™ reaches to the value of ‘n’.

First we must know whatÂ **Fibonacci series**Â is.

**0 1 1 2 3 5 8 13 21………..**

By definition, the first Fibonacci number is â€˜0â€™ and second Fibonacci number is â€˜1â€™. Then each subsequent number is calculated based on sum of the previous two. Numbers of Fibonacci sequence are known as Fibonacci numbers.

This sequence has many applications inÂ **mathematics**Â andÂ **Computer Science**.

Here in the program we have two initial values of series, ‘0’ and ‘1’ in variables ‘first’ and ‘sec’ respectfully.

Then user enters the Fibonacci number in variable ‘**n**‘.

Here the loop starts from value â€˜1â€™ and ends when its value reaches to the value equal to â€˜nâ€™.

In loop,Â the value of first and sec are added and stored in variable first, thenÂ value of first and sec are subtracted and stored in variable sec. At last the value of sec is printed.