Write a program to print perfect squares till a given input number. Spaces between the numbers are important and all the output should be in single line. Use System.out.println or System.out.print for printing.
Input |
Printed Output |
125 |
1 4 9 16 25 36 49 64 81 100 121 |
50 |
1 4 9 16 25 36 49 |