CJCoding With Joseph
15free / daySign inCreate account

Numbers 1 to 20 on One Line

Use 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 — print one after the last line.

Hints2 available
Topics:
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.