Answer:
import math
h = 19
total = 0
for i in range(1, h):
if math.sqrt(i) - int(math.sqrt(i)) == 0:
total += i
print(total)
Explanation:
*The code is in Python.
Initialize the h and total
Create a for loop that iterates from 1 to h. Inside the loop, check if the difference between the square root of a number and the integer part of the square root of that number is equal to 0 (This means the number is a perfect square. For example, if the number is 3, the square root is 1.73 and the integer part of this is 1, the difference is 0.73, not 0. However, if the number is 4, the square root is 2.0 and the integer part is 2, the difference is 0), add that number to the total
When the loop is done, print the total.