fn fact(n: u32) -> u32 {
    if n < 2 { return 1; }
    return n * fact(n - 1);
}
fn main() {
    for i in 0..11 {
        println!("{}! = {}", i, fact(i));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: