functions5.rs (228B)
1 fn square(num: i32) -> i32 { 2 // Removed the semicolon `;` at the end of the line below to implicitly return the result. 3 num * num 4 } 5 6 fn main() { 7 let answer = square(3); 8 println!("The square of 3 is {answer}"); 9 }
rustlingssolving rustlings ft. dracuxan | |
| git clone [email protected]:dracuxan/rustlings.git | |
| Log | Files | Refs |