mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
Complete functions5
This commit is contained in:
parent
2a7fcefae0
commit
cf1875b784
@ -1,13 +1,11 @@
|
||||
// functions5.rs
|
||||
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let answer = square(3);
|
||||
println!("The square of 3 is {}", answer);
|
||||
}
|
||||
|
||||
fn square(num: i32) -> i32 {
|
||||
num * num;
|
||||
return num * num;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user