HSC Science (Computer Science) 12th Board ExamMaharashtra State Board
Share
Notifications

View all notifications

Write a C++ program to display a series of 15 term of the Fibonacci Series. - HSC Science (Computer Science) 12th Board Exam - Computer Science 1

Login
Create free account


      Forgot password?

Question

Write a C++ program to display a series of 15 term of the Fibonacci Series.

Solution

//Program to generate fibonacci series
#include < iostream.h>
void main ( )
{ int f0, f1, f, n;
f0 = 0;
f1 = 1;
clrscr ( );
cout<<“Fibbonacci series\n”;
cout<<“n” <<f0<<“\n”<<f1;
for (n=1; n<=20; n++)
{
f=f0 + f1;
cout<<“\n”<<f;
f0 = f1;
f1 = f;
}
}
  Is there an error in this question or solution?

APPEARS IN

 2016-2017 (March) (with solutions)
Question 5.2.2 | 5.00 marks
Solution Write a C++ program to display a series of 15 term of the Fibonacci Series. Concept: C++ Programming.
S
View in app×