Loops/While

fn main() {
    let i = 1024;
    while i > 0 {
        println "{i}";
        i /= 2;
    }
}

Output:

1024
512
256
128
64
32
16
8
4
2
1

Attribution: This is a community solution for the Rosetta Code task Loops/While in Zen C.

This article uses material from the Rosetta Code article Loops/While, which is released under the GNU Free Documentation License 1.3. A list of the original authors can be found in the page history.