Complete the code to print "Hello, world!" in Rust.
fn main() {
println!([1]);
}The println! macro prints text to the screen. The text must be inside double quotes.
Complete the code to declare the main function in Rust.
fn [1]() { println!("Hello from Rust!"); }
The entry point of a Rust program is the main function.
Fix the error in the code to correctly print a message.
fn main() {
println!([1]);
}The argument to println! must be a string literal enclosed in double quotes.
Fill both blanks to create a function that prints a greeting.
fn [1]() { println!([2]); }
main as function name when a different name is asked.The function name can be greet, and the message must be a string literal like "Hello, friend!".
Fill all three blanks to print a custom message inside the main function.
fn [1]() { let message = [2]; println!([3]); }
The main function is named main. The variable message holds the string "Rust is fun!". The println! macro prints the variable message.
