Write the program for fibonacci in c++?
Answer Posted / joy
#include<iostream.h>
#include<conio.h>
voidmain()
{
clrscr();
int f1=0,f2=1,f3,n,i;
cout<<"Enter the number of terms...";
cin>>n;
cout<<"Fibonacci Series\n";
cout<<f1<<'\n'<<f2<<'\n';
for(i=3;i<=n;i++)
{
f3=f1+f2;
cout<<f3<<'\n';
f1=f2;
f2=f3;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is std :: flush?
Name the implicit member functions of a class.
What are signs of manipulation?
Are c and c++ different?
What is the this pointer?
Can we use clrscr in c++?
What is runtime errors c++?
Can circle be called an ellipse?
What is the real purpose of class – to export data?
Is c++ high level programming language?
what is upcasting in C++?
Can we overload operator in c++?
To what does “event-driven” refer?
Is java a c++?
What language is a dll written in?