Add Numbers
Create a function called add that takes two i32 parameters and returns their sum. Then call it from main and print the result.
Expected output:
text
3 + 5 = 8
Hints:
- Define with
fn add(a: i32, b: i32) -> i32 - The last expression without a semicolon is the return value:
a + b - In
main, useprintln!("3 + 5 = {}", add(3, 5));
rust
fn main() {
}