you are given two given numbers, A and B where 1<= A <=B, write a program to find the number of perfect squares in range A to B (including A and B).
A= int(input("Enter the Lower bound: "))
B=int(input("Enter the Upper bound: "))
j=1
for i in range(A, B+1):
while(j<=((i//2)+1)):
if(j**2==i):
print(i)
j+=1
j=1
Enter the Lower bound: 4
Enter the upper bound: 56
4
9
16
25
36
49
Comments
Leave a comment