Fibonacci function by using simple recursive approach, C/C++ Programming

Implement, in rPeANUt, the a Fibonacci function by using the simple recursive approach. The Fibonacci function can be implemented in c as follow:

int fib(int x) {

  if (x<2) {

    return x;

  } else {

    return fib(x-1) + fib(x-2);

  }

}

Test your implementation (e.g. fib(5) == 5, fib(7) == 13, fib(8) == 21)? What is the biggest Fibonacci number you can calculate in under about 1min of execution time?

 

 

Posted Date: 3/8/2013 6:24:10 AM | Location : United States







Related Discussions:- Fibonacci function by using simple recursive approach, Assignment Help, Ask Question on Fibonacci function by using simple recursive approach, Get Answer, Expert's Help, Fibonacci function by using simple recursive approach Discussions

Write discussion on Fibonacci function by using simple recursive approach
Your posts are moderated
Related Questions
wap to count the numof string present in a word

write a program for convert numbers upto 9 to alphabet?Eg.now enter the inputis 666 means output is "0" lphabet

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed

A more advanced data type is the structure; here we can define a template as a collection of different variables e.g.     struct birthdate   {     int month;     int day;

A Network of routers have been configured for the purposes of handling data traffic within your company. You would like to have an application that does a network

Define Storage Classes of c program - computer programming? Each variable and function in C language has two attributes that are type and storage class. If storage class of a v

Develop a biomedical imaging project Project Description: This is a biomedical imaging project. Skills required are C++ Programming, Cocoa, Mac OS, Objective C

write a program to find the minimum number of shelves

In this assignment, you will develop a program named "match" to be used by a dating service to form couples. Given the number of gentlemen, the number of ladies, and a list of acce