Write a program to print the numbers till the input using while
loop. The spaces between the numbers are important and they should be in one line. Use System.out.println or System.out.print for printing.
Integer (Input) |
Printed Output |
4 |
1 2 3 4 |
6 |
1 2 3 4 5 6 |
10 |
1 2 3 4 5 6 7 8 9 10 |