Output using println macro
๐ Scenario: You are creating a simple Rust program that greets a user by name. This is like writing a friendly note to someone.
๐ฏ Goal: Build a Rust program that stores a name in a variable and then prints a greeting message using the println! macro.
๐ What You'll Learn
Create a variable called
name with the exact value "Alice"Create a variable called
greeting with the exact value "Hello"Use the
println! macro to print the greeting and the name in the format: Hello, Alice!๐ก Why This Matters
๐ Real World
Printing messages is the first step in many programs, like showing information or debugging.
๐ผ Career
Understanding how to output text is essential for any Rust developer to communicate with users or log data.
Progress0 / 4 steps