Complete variable exercises.

This commit is contained in:
Arjun Pathmarajan 2017-03-26 12:13:20 -07:00
parent b5bbd7247a
commit 3ee010d43e
4 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
// Make me compile! Scroll down for hints :)
fn main() {
x = 5;
let x = 5;
println!("x has the value {}", x);
}

View file

@ -1,7 +1,7 @@
// Make me compile! Scroll down for hints :)
fn main() {
let x;
let x: i32 = 30;
if x == 10 {
println!("Ten!");
} else {

View file

@ -1,7 +1,7 @@
// Make me compile! Scroll down for hints :)
fn main() {
let x = 3;
let mut x = 3;
println!("Number {}", x);
x = 5;
println!("Number {}", x);

View file

@ -1,7 +1,7 @@
// Make me compile! Scroll down for hints :)
fn main() {
let x: i32;
let x: i32 = 37;
println!("Number {}", x);
}