Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Calculate factorial

// Calculate factorial

fn factorial(n: u64) -> u64 {
    (1..=n).product()
}

fn main() {
    println!("Factorial = {} ", factorial(5) );
}
 
PREVIOUS NEXT
Tagged: #Calculate #factorial
ADD COMMENT
Topic
Name
9+3 =