Introduction
Operator precedence tells us which part of a math or logic expression to solve first, so the computer gets the right answer.
value1 operator1 value2 operator2 value3
let result = 2 + 3 * 4;
let result = (2 + 3) * 4;
let is_true = true || false && false;
fn main() {
let a = 5 + 2 * 3;
let b = (5 + 2) * 3;
let c = true || false && false;
println!("a = {}", a);
println!("b = {}", b);
println!("c = {}", c);
}+, *, -, /?(2 + 3) * 4 uses parentheses to add 2 and 3 first, then multiplies by 4, which matches the requirement.let result = 10 - 4 / 2 + 3 * 2;
println!("{}", result);let value = 5 + 3 * / 2;
* / operators together without a number between them, which is invalid syntax in Rust.let x = 2 + 3 * 4 - 6 / 3 + (8 - 5) * 2;
x after evaluation?Pass the test and this pattern moves unknown