Complete variables section
This commit is contained in:
parent
b8368de6d5
commit
d578d1966a
exercises/variables
|
@ -2,7 +2,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
x = 5;
|
let x = 5;
|
||||||
println!("x has the value {}", x);
|
println!("x has the value {}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x;
|
let x: u32 = 9;
|
||||||
if x == 10 {
|
if x == 10 {
|
||||||
println!("Ten!");
|
println!("Ten!");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 3;
|
let mut x = 3;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
x = 5;
|
x = 5;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Make me compile! Scroll down for hints :)
|
// Make me compile! Scroll down for hints :)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: i32;
|
let x: i32 = 69;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue