diff --git a/loops/src/main.rs b/loops/src/main.rs index ca070c7..38fd301 100644 --- a/loops/src/main.rs +++ b/loops/src/main.rs @@ -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}!"); + while index < 5 { + println!("the value is: {}", a[index]); - number -= 1; + index += 1; } - - println!("LIFTOFF!!!"); }