Why Nostr? What is Njump?
2023-02-07 17:21:55
in reply to

dave on Nostr: fn factorial(number: i32) -> i32 { // Base Case if number == 0 { return 1; } // ...

fn factorial(number: i32) -> i32 {
// Base Case
if number == 0 {
return 1;
}

// Recursive Case
return number * factorial(number-1);
}

fn main() {
println!("Factorial of 4 is: {}", factorial(4));
}
Author Public Key
npub1tsgw6pncspg4d5u778hk63s3pls70evs4czfsmx0fzap9xwt203qtkhtk4