Count to N. Given an integer N, write a program to print all the numbers from 1 to N, each on a new line.
Test | Input | Output |
---|---|---|
Test 1 | 5 | 1 2 3 4 5 |
Test 2 | 1 | 1 |
Test 3 | 10 | 1 2 3 4 5 6 7 8 9 10 |
Test 4 | 3 | 1 2 3 |
Test 5 | 7 | 1 2 3 4 5 6 7 |
Python, Java
Count to N. Given an integer N, write a program to print all the numbers from 1 to N, each on a new line.
Test | Input | Output |
---|---|---|
Test 1 | 5 | 1 2 3 4 5 |
Test 2 | 1 | 1 |
Test 3 | 10 | 1 2 3 4 5 6 7 8 9 10 |
Test 4 | 3 | 1 2 3 |
Test 5 | 7 | 1 2 3 4 5 6 7 |