varialbes clear

This commit is contained in:
blacktoast 2021-09-28 05:58:55 +00:00
parent 30b4480ca3
commit 4188ca26a7
6 changed files with 7 additions and 6 deletions

View File

@ -5,5 +5,5 @@ When a variable is immutable, once a value is bound to a name, you cant chang
You can make them mutable by adding mut in front of the variable name. You can make them mutable by adding mut in front of the variable name.
## Further information ## Further information
tt
- [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html) - [Variables and Mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html)

View File

@ -9,6 +9,6 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x = 5; let x = 7;
println!("x has the value {}", x); println!("x has the value {}", x);
} }

View File

@ -4,7 +4,7 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x = 3; let mut x = 3;
println!("Number {}", x); println!("Number {}", x);
x = 5; // don't change this line x = 5; // don't change this line
println!("Number {}", x); println!("Number {}", x);

View File

@ -4,6 +4,6 @@
// I AM NOT DONE // I AM NOT DONE
fn main() { fn main() {
let x: i32; let x: i32=50;
println!("Number {}", x); println!("Number {}", x);
} }

View File

@ -6,6 +6,6 @@
fn main() { fn main() {
let number = "T-H-R-E-E"; // don't change this line let number = "T-H-R-E-E"; // don't change this line
println!("Spell a Number : {}", number); println!("Spell a Number : {}", number);
number = 3; let number=3;
println!("Number plus two is : {}", number + 2); println!("Number plus two is : {}", number + 2);
} }

View File

@ -4,8 +4,9 @@
/* /*
I AM NOT DONE I AM NOT DONE
*/ */
const NUMBER=1; const NUMBER:i32 =1;
fn main() { fn main() {
println!("Number {}", NUMBER); println!("Number {}", NUMBER);
} }