Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Fix the Parameter

This function is supposed to print someone's age, but the parameter type is wrong. Can you fix it?

Expected output:

text
You are 10 years old!

Hint: The function is being called with a number, so the parameter type should be i32, not &str!

rust
fn print_age(age: &str) {
println!("You are {} years old!", age);
}

fn main() {
print_age(10);
}