mirror of https://github.com/rust-lang/rustlings
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
264 B
Rust
16 lines
264 B
Rust
7 years ago
|
// functions5.rs
|
||
1 year ago
|
//
|
||
|
// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
|
||
|
// hint.
|
||
9 years ago
|
|
||
5 years ago
|
// I AM NOT DONE
|
||
|
|
||
9 years ago
|
fn main() {
|
||
|
let answer = square(3);
|
||
2 years ago
|
println!("The square of 3 is {}", answer);
|
||
9 years ago
|
}
|
||
|
|
||
|
fn square(num: i32) -> i32 {
|
||
|
num * num;
|
||
|
}
|