Complete the code to define the main function in Rust.
fn [1]() { println!("Hello, world!"); }
The main function is the entry point of a Rust program.
Complete the code to print a message inside the main function.
fn main() {
[1]!("Welcome to Rust!");
}print which does not add a newline.The println! macro prints text with a newline at the end.
Fix the error in the function declaration to make it valid Rust code.
fn main[1] { println!("Fixed function"); }
{} instead of parentheses.Functions in Rust require parentheses () after the name, even if no parameters.
Fill both blanks to create a valid Rust program that prints a message.
fn [1]() { [2]!("Hello from Rust!"); }
print instead of println.The program needs the main function and the println! macro to print the message.
Fill all three blanks to define a main function that prints a formatted message.
fn [1]() { [2]!("Number: {}", [3]); }
print instead of println.The main function uses println! macro to print the number 42 formatted inside the string.
