edlang/programs/example.ed

20 lines
326 B
Rust
Raw Normal View History

2024-01-15 10:42:24 +00:00
mod Main {
fn add(a: i32, b: i32) -> i32 {
return a + b;
}
2023-03-25 14:29:49 +00:00
2024-01-15 20:36:53 +00:00
fn check(a: i32) -> i32 {
if a == 2 {
return a;
} else {
return 0;
}
}
2024-02-14 07:53:47 +00:00
pub fn main(argc: i32) -> i32 {
2024-01-15 10:42:24 +00:00
let x: i32 = 2 + 3;
let y: i32 = add(x, 4);
return y;
}
2023-03-25 14:29:49 +00:00
}