While over an array

This commit is contained in:
Dan Buch 2017-12-22 10:29:59 -05:00
parent 19b85a6a18
commit 4ab48a6470
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -1,11 +1,10 @@
fn main() {
let mut number = 3;
let a = [10, 20, 30, 40, 50];
let mut index = 0;
while number != 0 {
println!("{}!", number);
number = number - 1;
while index < 5 {
println!("the value is: {}", a[index]);
index = index + 1;
}
println!("LIFTOFF!!!");
}