rust/src/test/run-pass/while-and-do-while.rs

8 lines
164 B
Rust
Raw Normal View History

fn main() {
2011-07-27 07:19:39 -05:00
let x: int = 10;
let y: int = 0;
while y < x { log y; log "hello"; y = y + 1; }
do { log "goodbye"; x = x - 1; log x; } while x > 0
}