Difference between revisions of "Fibonacci"

From Minor Miracle Software
Jump to: navigation, search
(Created page with " <pre> /* Recursive Fibonacci function. Author: Jesse B. Dooley Purpose: Implement a recursive Fibonacci function in C. Consideration: Use unsigned long for maximum...")
 
(No difference)

Latest revision as of 22:32, 14 May 2016

/*
  Recursive Fibonacci function.
  Author: Jesse B. Dooley
  Purpose: Implement a recursive Fibonacci function in
  C.
  Consideration: Use unsigned long for maximum data size.
  Date: 1-JAN-1995
*/

unsigned long fibonacci( unsigned long ul_Fibonacci )
{
	if ( ul_Fibonacci == 0 || ul_Fibonacci == 1)
		return ul_Fibonacci;
	else
		return fibonacci( ul_Fibonacci - 1 ) + fibonacci( ul_Fibonacci - 2);
}

Internal Links

Parent Article: Programming Portfolio