Exercise 1 · Chapter: While LoopsRequired+50 XP
Count to Five
Use a while loop to print the numbers 1 through 5, one per line.
Expected output:
1 2 3 4 5
Hints:
- Start with
let mut count = 1; - Loop while
count <= 5 - Don't forget to increase
countby 1 each time!
rust
fn main() {
}
Output
Run your code to see the output here.