#include<iostream.h> #include<conio.h> void main() { clrscr(); int a=0,b=1,c,r,i; cout<<"Enter the length:\t"; cin>>r; cout<<a<<"\t"<<b<<"\t"; for(i=0;i<r;i++) { c=a+b; cout<<c<<"\t"; a=b; b=c; } getch(); }
Share if you liked this Post using your favorite sharing service:
Subscribe Updates, Its FREE!