Numbers 1 to 20 on One Line
easyQuestion 328Use a loop to print the numbers 1 to 20 on a single line separated by single spaces, with no trailing space, then a newline. The exact output is what is shown in Expected Output.
Print a space BEFORE each number except the first.
Expected output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20= newline. The output ends with a newline, so 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 · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.