rust declare multiple mutable variables
In Rust, you can declare multiple mutable variables using the let
keyword. Here is an example:
fn main() {
let mut x = 5;
let mut y = 10;
let mut z = 15;
// Do something with the variables...
}
In this example, the variables x
, y
, and z
are declared as mutable using the mut
keyword. This allows you to change their values later in the program. You can then perform any desired operations on these mutable variables.