This commit is contained in:
2023-06-09 12:54:08 +02:00
parent 6e1cd4e0fc
commit 61e19478bd
3 changed files with 18 additions and 0 deletions

8
whileloop/Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "whileloop"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

9
whileloop/src/main.rs Normal file
View File

@@ -0,0 +1,9 @@
fn main() {
let mi_arreglo = ["Lovecraft", "Poe", "Barker", "King"];
let mut i = 0;
while i < mi_arreglo.len() {
println!("{}", mi_arreglo[i]);
i = i + 1;
}
}