Program to generate the Fibonacci series
Tuesday, August 11, 2020C++ is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation.
//Program to generate the Fibonacci series
#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int x=0,y=1,z,n,i=3;
cout<<"\n Enter The Number Of Term :";
cin>>n;
cout<<x<<" "<<y<<" ";
do
{z=x+y;
cout<<z<<" ";
x=y;
i++;
}while(i<=n);
getch();
}
0 Comments