Initial commit
This commit is contained in:
9
solutions/01_variables/variables4.rs
Normal file
9
solutions/01_variables/variables4.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
// In Rust, variables are immutable by default.
|
||||
// Adding the `mut` keyword after `let` makes the declared variable mutable.
|
||||
let mut x = 3;
|
||||
println!("Number {x}");
|
||||
|
||||
x = 5;
|
||||
println!("Number {x}");
|
||||
}
|
||||
Reference in New Issue
Block a user