Complete the code to declare a variable named x with the value 5.
let [1] = 5;
var which is not Rust syntax.In Rust, let declares a variable. Here, x is the variable name.
Complete the code to print the value of the variable y.
println!("The value is: {}", [1]);
To print the value of a variable, use its name without quotes.
Fix the error by completing the code to make the variable mutable.
let [1] counter = 0;
var which is not Rust syntax.mut in the wrong place.In Rust, mut makes a variable mutable so its value can change.
Fill both blanks to declare a mutable variable score with value 10 and then increase it by 5.
let [1] score = 10; score [2] 5;
= instead of += which replaces the value.Use mut to make score mutable and += to add 5 to it.
Fill all three blanks to declare a variable name with value "Alice", print it, and then change it to "Bob".
let [1] name = "Alice"; println!("Name: {}", [2]); name [3] "Bob";
Make name mutable with mut, print it by its name, and assign a new value with =.
