Anda di halaman 1dari 2

#include<iostream.h> #include<conio.

h>

class series { int n,i,j,k,l; public: series(int x) { n=x; }

series( series &y); };

series::series( series &y) { j=0; k=1; cout<<"\n the series is :"; cout<<j<<endl; cout<<k<<endl;

for(i=0;i<=y.n;i++) { l=j+k; j=k; k=l; cout<<l<<endl; } }

void main() { clrscr(); int z; cout<<"\n entre the no:"<<endl; cin>>z; series A(z),A2(A); getch(); }

Anda mungkin juga menyukai