Skip to content
Quiz · Conditions and Loops · lesson 4 of 6

Quiz — a value from loop

What does the program print?

Rust
fn main() {
    let mut count = 0;
    let result = loop {
        count += 1;
        if count == 10 {
            break count * 2;
        }
    };
    println!("{result}");
}