Created
April 17, 2012 23:52
-
-
Save rikaardhosein/2409972 to your computer and use it in GitHub Desktop.
Recursive Fibonacci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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