Welcome..!!

Please visit http://csprograms.in/ for more Computer Science programs.

Tuesday 13 March 2012

5. C++ program to find the Fibonacci series.


#include <iostream>
int main()
{
int x, i, j, n, m;
cout <<"Enter the total number \n";
cin >>n;
cout <<"Total number of the series is \n"<< n;
i=0,j=1;
cout <<i<<j;
for(x=3;x<=n;x++)
{m=i+j;
cout <<"\n"<<m;
i=j;j=m;
}
return 0;
}

1 comment: