Answer:
Following are the statement is given below
Int total=0; // variable declaration
int k=1; // variable declaration
while(k<=50) // iterating the loop
{
total=total+k*k; // calculating sum of the squares
k++; // increment the value of k
}
Step-by-step explanation:
Following are the description of the above statement
- Declared a variable total and k of int type.
- Initialized total to 0 and k to 1.
- iterating the while loop up to the value 50.
- In this while calculating the calculating sum of the squares in the total variable.
- increment the value of k by 1. This loop is executed until 50.