Exercises

We'll cover the following...

Exercise 1

Q

What is true about the following program?

fn main() {
    let name = {
        "Michael"
    };
    println!("My name is {}", name);
}
A)

It wouldn’t compile

B)

It displays

My name is “{Michael}”

C)

It displays

My name is “Michael”

D)

It displays

My name is Michael

Exercise 2

Add the closing pair to all of the unclosed symbols:

Press + to interact
fn main( {
println!("4 + 5 == {}, {{ 4 + 5
...