Fibonacci series:The first two Fibonacci numbers are 0 and 1, and each remaining number is the sum of the previous two
e.g.: 0 1 1 2 3 5 8 13 21 ....
A number n is taken from user and the series is displayed upto nth term.
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- void main()
- int a=0,b=1,c=0,n;
- cout<<"Enter the number of terms you wanna see: ";
- cout<<a<<" "<<b<<" ";
- for(int i=1;i<=n-2;i++)
- //Coding by: Snehil Khanor
- cout<<c<<" ";