Skip to content

Instantly share code, notes, and snippets.

@rikaardhosein
Created April 17, 2012 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikaardhosein/2409972 to your computer and use it in GitHub Desktop.
Save rikaardhosein/2409972 to your computer and use it in GitHub Desktop.
Recursive Fibonacci
unsigned int Fib( unsigned int n )
{
if( n == 0 ) return 0;
if( (n==1) || (n==2) ) return 1;
else return Fib(n-1)+Fib(n-2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment