1. Engineering
  2. Computer Science
  3. assume there is a variable h already associated with a...

Question: assume there is a variable h already associated with a...

Question details

Assume there is a variable, h already associated with a positive integer value. Write the code necessary to compute the sum of the first h perfect squares, starting with 1. (A perfect square is an integer like 9, 16, 25, 36 that is equal to the square of another integer (in this case 3*3, 4*4, 5*5, 6*6 respectively).) Associate the sum you compute with the variable gq. For example, if h is 4, you would assign 30 to qbecause the first 4 perfect squares Submit History:x (1 of 1) 01/24/19 07:31:06 3 while ((i*i)<h): 5 i+ 1

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution