Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Say Hello Function

Create a function called say_hello that prints Hello! — then call it 3 times from main.

Expected output:

text
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() {
}