6.1. While: List of squares
pole55 (204)

"For a given integer N, print all the squares of positive integers where the square is less than or equal to N, in ascending order."

Example input

Example output
1 4 9 16 25 36 49

You are viewing a single comment. View All
pole55 (204)

@girianshiido This code publishes only squares which are less than a given number. We have "if i*2 <= x" here for this. it is equal to your "while ii <= x". just try it // Link to the task: https://repl.it/student/submissions/3764967