menu search
person
Write a program in C++, to print first 15 terms of Fibonacci series
thumb_up_alt 0 like thumb_down_alt 0 dislike
3 views

1 Answer

 
verified
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 ::


thumb_up_alt 0 like thumb_down_alt 0 dislike
...