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 is virtual destructor ans explain its use?

1133


Explain linked list using c++ with an example?

1087


What are exceptions c++?

1046


Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL

812


Which programming language is best?

992


How do I run a program in notepad ++?

1115


How a pointer differs from a reference?

1350


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

1119


which operator is used for performing an exponential operation a) > b) ^ c) none

1066


What is the difference between reference and pointer?

1168


How delete [] is different from delete?

1012


What is :: operator in c++?

1058


What is c++ prototype?

1217


Can we specify variable field width in a scanf() format string? If possible how?

1271


What is the best way to declare and define global variables?

1335