Greeting
Create a function called greet that takes a name (&str) and prints a personalized greeting. Call it for three different names.
Expected output:
text
Hello, Alice! Hello, Bob! Hello, Charlie!
Hints:
- Define with
fn greet(name: &str) - Inside, use
println!("Hello, {}!", name); - Call it three times with different names
rust
fn main() {
}