Skip to content

Instantly share code, notes, and snippets.

@az7arul
Created August 13, 2013 04:15
Show Gist options
  • Save az7arul/6217845 to your computer and use it in GitHub Desktop.
Save az7arul/6217845 to your computer and use it in GitHub Desktop.
factorial in rust
fn main(){
fn re_fac(n: int) -> int {
if n < 2 {
1
} else {
n * re_fac( n - 1 )
}
}
let num = re_fac(5);
println(fmt!("%d",(num)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment