Rust: boolean values true and false



examples/booleans/bool/src/main.rs
fn main() {
    let x = true;
    let y = false;

    println!("x is {x}");
    println!("y is {y}");

    if x {
        println!("x in if part");
    } else {
        println!("x in else part");
    }

    if y {
        println!("y in if part");
    } else {
        println!("y in else part");
    }
}

x is true
y is false
x in if part
y in else part