edlang/lib/edlang_driver/tests/programs/factorial.ed
2024-02-16 11:48:15 +01:00

15 lines
250 B
Rust

mod Main {
pub fn main() -> i32 {
let b: i32 = factorial(4);
return b;
}
fn factorial(n: i32) -> i32 {
if n == 1 {
return n;
} else {
return n * factorial(n - 1);
}
}
}