Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Tell me an example where stacks are useful?

1028


Is c++ vector dynamic?

1105


How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

1029


Explain the use of vtable.

1082


What is doubly linked list in c++?

1076


When do we run a shell in the unix system? How will you tell which shell you are running?

974


Is nan a c++?

1138


What does the linker do?

1028


What is pointer in c++ with example?

1066


What are the rules about using an underscore in a c++ identifier?

1175


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1085


How new/delete differs from malloc()/free?

1136


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

1139


What is a manipulator in c++?

1231


What are smart pointers?

2252