← Back to Loops
Question 354
Count Down To One
Count Down To One
Read a starting number and use a while loop to print it, then every smaller whole number down to 1, one value per line. Input: one integer of at least 1, no prompt. The loop header is already written; fill in its body so the first line printed is the number that was read.
Expected Output:
5 4 3 2 1
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.