Complete the code to check if both conditions are true.
let a = true; let b = false; let result = a [1] b; println!("{}", result);
The && operator returns true only if both a and b are true.
Complete the code to check if either condition is true.
let x = false; let y = true; let result = x [1] y; println!("{}", result);
The || operator returns true if at least one of x or y is true.
Fix the error in the code to correctly negate the boolean value.
let flag = true; let negated = [1]flag; println!("{}", negated);
The ! operator negates a boolean value in Rust.
Fill both blanks to create a condition that is true only if a is true and b is false.
let a = true; let b = false; if a [1] [2] b { println!("Condition met"); }
The condition uses && to require both parts true, and ! to negate b.
Fill all three blanks to create a condition that is true if either x is false or y is true and z is true.
let x = true; let y = false; let z = false; if [1] x [2] y [3] z { println!("Complex condition met"); }
The condition reads: if !x || y && z, which means true if x is false or both y and z are true.
