Recall & Review
beginner
What is the entry point of a Rust program?
The entry point of a Rust program is the
fn main() function. This is where the program starts running.Click to reveal answer
beginner
How do you print text to the console in Rust?
You use the
println! macro to print text to the console. For example: println!("Hello, world!");Click to reveal answer
intermediate
What does the exclamation mark (!) mean in
println!?The exclamation mark means
println! is a macro, not a regular function. Macros can do things functions can't, like generating code.Click to reveal answer
beginner
Why do Rust programs need a
main function?Rust programs need a
main function because it tells the computer where to start running the code, like the front door of a house.Click to reveal answer
beginner
What file extension do Rust source files use?
Rust source files use the
.rs file extension. For example, main.rs is a common file name for the first program.Click to reveal answer
What keyword starts the main function in Rust?
✗ Incorrect
The
fn keyword is used to define functions in Rust, including main.Which macro prints text to the console in Rust?
✗ Incorrect
println! is the correct macro to print text with a newline in Rust.What file extension should you use for Rust source files?
✗ Incorrect
Rust source files use the
.rs extension.What does the exclamation mark (!) after
println indicate?✗ Incorrect
The exclamation mark means
println! is a macro, not a normal function.What is the purpose of the
main function in Rust?✗ Incorrect
The
main function is where the program starts running.Explain how to write and run your first Rust program that prints "Hello, world!".
Think about the main function, printing, and file naming.
You got /4 concepts.
Describe the role of macros in Rust and how they differ from functions, using println! as an example.
Focus on syntax and purpose differences.
You got /4 concepts.