In Rust, an expression evaluates to a value, while a statement performs an action and returns no value. You can use expressions anywhere a value is expected, but statements are limited to specific contexts like the body of a function.
fn main() {
// Expression: evaluates to 5, assigned to x
let x = 5;
// Statement: performs assignment, returns ()
let y = 10;
// Expression: evaluates to 15, assigned to z
let z = x + y;
// Statement: prints value, returns ()
println!("z is {z}");
}