Write the program for fibonacci in c++?
Answer Posted / irushad abdulrahman
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a=-1, b=1, c, x;
cout << "Enter a number to find FIBONACCI less than
that:";
cin >>x;
do
{
c=a+b;
cout << c << "\t";
a=b;
b=c;
}
while (c<=(x-c));
cout <<"\n";
system ("pause");
return 0;
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a memory leak c++?
What is setw manipulator in c++?
Is arr and &arr are same expression for an array?
What are the steps in the development cycle?
What is called array?
Are strings mutable in c++?
Why cout is used in c++?
What are the unique features of C++.
How do I write a c++ program?
Do inline functions improve performance?
What is the prototype of printf function?
What is a map in c++?
Write about the members that a derived class can add?
What is oops in c++?
How does work in c++?