Line 13, casts the input variable to a double type and passes it in the sqrt() function to calculate the square root. The result is the cast back to an int and stored in the array.
Line 14, calculates the 'remainder' used in the next iteration. So it calculates the square of the final result from line 13 and subtracts it from the initial value.
e.g. the square root of 5 is 2.23... converted back to an int is 2. This will leave 1 as the starting point for the next iteration.