Skip to content
doubtly

1 answer

Best answer

Note:: This code only work on turbo c++


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

void main()
{
 int n1,n2,n,i;

 clrscr();
 n1=0;
 n2=1;

 cout<<"Fibonacci series :"<<endl;
 cout<<n1<<endl;
 cout<<n2<<endl;
 for (i=3;i<=15;i++)
 {
n=n1+n2;
cout<<n<<endl;
n1=n2;
n2=n;
  }
  getch();
}

Output ::

https://lh3.googleusercontent.com/-NRU1OUicR2o/YYkZ0NBlLaI/AAAAAAAACsM/2aow8y8_uBgxnTjToxrZcQjlWYNemr6FgCLcBGAsYHQ/image.png
Doubtly · 8 Nov 2021 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.