Exerpad
🔥 0
0 XP
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() above fn main()
  • Inside the function, use println!("Hello!");
  • Call it three times inside main with say_hello();
rust
fn main() {
}
Output
Run your code to see the output here.