Countdown
Use a while loop to print a countdown from 10 down to 1, then print "Liftoff!" on the last line.
Expected output:
text
10 9 8 7 6 5 4 3 2 1 Liftoff!
Hints:
- Start with
let mut n = 10; - Loop while
n >= 1 - Subtract 1 from
neach time - Print
"Liftoff!"after the loop ends
rust
fn main() {
}