summaryrefslogtreecommitdiff
path: root/solutions/02_functions/functions5.rs
blob: 03354186b97bcd77c786844a3345737c9466b75a (plain)
1
2
3
4
5
6
7
8
9
fn square(num: i32) -> i32 {
    // Removed the semicolon `;` at the end of the line below to implicitely return the result.
    num * num
}

fn main() {
    let answer = square(3);
    println!("The square of 3 is {answer}");
}