29.8k views
0 votes
Write a while loop that prints a. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.

User Datwelk
by
8.6k points

1 Answer

3 votes

Answer:

n = input()

a = 0

while pow(a, 2) < n:

print(pow(a, 2))

a += 1

Explanation:

User Ldoogy
by
8.1k points