Search⌘ K
AI Features

Puzzle 20: Hello, Bonjour

Explore the Rust puzzle Hello Bonjour by predicting its program output. This lesson challenges your understanding and helps you sharpen problem-solving skills in Rust programming.

We'll cover the following...

Guess the output

Before moving on to the explanation, try to guess the output of the following program. Good luck!

Rust 1.40.0
fn main() {
let hello = || println!("Hello World");
let hello = || println!("Bonjour le monde");
hello();
}

Quiz

Technical Quiz
1.

What is the output of the above code?

A.
Hello World
B.

The code throws an error message indicating that the same variable has been assigned two different values.

C.
Bonjour le monde
D.
Bonjour le monde Hello World

1 / 1