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 / darren chang

int fib(int input)
{
if(input==0)
return 0;
if((input==1)||(input==2))
return 1;
else
return fib(input-1)+fib(input-2);
}

Is This Answer Correct ?    10 Yes 31 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are inline functions? What is the syntax for defining an inline function?

1100


What is the best book for c++ beginners?

986


Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be

1367


If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?

992


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1012


Define what is constructor?

1012


What is the type of 'this' pointer?

980


Is c better than c++?

1028


Search for: what is pair in c++?

1077


What is a dynamic binding in c++?

908


Explain the pure virtual functions?

1059


What is the most powerful coding language?

1007


What is the difference between interpreters and compilers?

1115


What is exception handling? Does c++ support exception handling?

978


What is a block in c++?

993