functions

This commit is contained in:
2026-09-07 08:08:30 +03:00
parent d04b26e5f3
commit 1f869d5cc8
18 changed files with 75 additions and 24 deletions
+7 -2
View File
@@ -1,4 +1,9 @@
fn square(num: i32) -> i32 {
// Removed the semicolon `;` at the end of the line below to implicitly return the result.
num * num
}
fn main() {
// DON'T EDIT THIS SOLUTION FILE!
// It will be automatically filled after you finish the exercise.
let answer = square(3);
println!("The square of 3 is {answer}");
}