← Back to archive

Stdle #147 · scope · 2026-10-31

What does this Rust snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

fn main() {
let n = 3;
let n = n + 1;
{
let n = n * 10;
println!("{}", n);
}
println!("{}", n);
}
Scope
2 lines
4 attempts left

Answer & explanation