RosettaCodeData/Task/Loops-While/Rust/loops-while.rs

8 lines
108 B
Rust
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
fn main() {
let mut n: i32 = 1024;
while n > 0 {
println!("{}", n);
n /= 2;
}
}