Answer:
int i=1 // initialized i to 1
int q=0 // initialized q to 10
while((i*i)<h) // iterating the while loop
{
q=(i*i)+q // calculating the sum of square
i=i+1 //Increment of i
}
Step-by-step explanation:
Following are the description of Program
- Initialized the variable "i" which is "int" type to 1.
- Initialized the variable "q" which is "int" type to 0.
- Iterating the while loop to less then variable "h".
- In this loop we calculate the sum of square and holding the result in the variable "q".
- Finally increment the value to "i" by 1 to iterating the loop.