← Back to archive

Stdle #70 · scope · 2026-08-15

What does this Rust snippet output?

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

fn main() {
let mut total = 0;
let total = {
for i in 1..4 { total += i; }
total + 100
};
println!("{}", total);
}
Scope
4 attempts left

Answer & explanation