0 votes
451 views
in Programming by (98.9k points)
edited
Write a program in C++, to print first 15 terms of Fibonacci series

1 Answer

0 votes
by (98.9k points)
selected by
 
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 ::


Related questions

0 votes
1 answer 158 views
0 votes
1 answer 165 views
0 votes
1 answer 104 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)
0 votes
1 answer 395 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

535 users

...