While over an array
This commit is contained in:
parent
19b85a6a18
commit
4ab48a6470
@ -1,11 +1,10 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let mut number = 3;
|
let a = [10, 20, 30, 40, 50];
|
||||||
|
let mut index = 0;
|
||||||
|
|
||||||
while number != 0 {
|
while index < 5 {
|
||||||
println!("{}!", number);
|
println!("the value is: {}", a[index]);
|
||||||
|
|
||||||
number = number - 1;
|
index = index + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("LIFTOFF!!!");
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user