Exercise 1 · Chapter: FunctionsRequired+50 XP
Say Hello Function
Create a function called say_hello that prints Hello! — then call it 3 times from main.
Expected output:
Hello! Hello! Hello!
Hints:
- Define your function with
fn say_hello()abovefn main() - Inside the function, use
println!("Hello!"); - Call it three times inside
mainwithsay_hello();
rust
fn main() {
}
Output
Run your code to see the output here.