Write the program for fibonacci in c++?
Answer Posted / ria
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr ();
int n,f1,f2,f3,i;
cout<<"/n input the no.of terms";
cin>>n;
f1=-1;
f2=1;
cout<<"/n the fibonacci series is ";
for(i=1,i<=n,i++)
{
f3=f1+f2;
cout<<"/n"<<f3;
f1=f2;
f2=f3;
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the rule of three?
Define the process of error-handling in case of constructor failure?
Why do we use string in c++?
What is expression parser in c++
Is c++ pass by reference or value?
What is the best c c++ compiler for windows?
Explain what you mean by a pointer.
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is a vector c++?
Can we define function inside main in c++?
Incase of a function declaration, what is extern means?
What are the differences between java and c++?
what are the iterator and generic algorithms.
Explain how the virtual base class is different from the conventional base classes of the opps.
What is a set in c++?