Created
June 6, 2020 00:05
-
-
Save tolumide-ng/b7fb313c038318606e263502f8461cf6 to your computer and use it in GitHub Desktop.
Fibonacci Series in Rust
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
pub fn fibonnacci_recursive(n: i32) -> i32 { | |
if n < 2 { | |
n | |
} else { | |
fibonnacci_recursive(n - 1) + fibonnacci_recursive(n - 2) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment