Add some exercises about variables!

This commit is contained in:
Carol (Nichols || Goulding) committed 2015-09-16 20:27:45 -04:00
1 parent 32900581b9
commit f4c6dcf1d7
5 files changed
+41

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
// Make me compile!
fn main() {
x = 5;
println!("x has the value {}", x);
}
+10
View File
@@ -0,0 +1,10 @@
// Make me compile!
fn main() {
let x;
if x == 10 {
println!("Ten!");
} else {
println!("Not ten!");
}
}
+8
View File
@@ -0,0 +1,8 @@
// Make me compile!
fn main() {
let x = 3;
println!("Number {}", x);
x = 5;
println!("Number {}", x);
}
+6
View File
@@ -0,0 +1,6 @@
// Make me compile!
fn main() {
let x: i32;
println!("Number {}", x);
}