square using while loop

write a program that gives the square of the first five numbers. and then gives the sum of these squares.
the output is:
1
4
9
16
25
the total is: 55
Do you know how to write a loop from 1 to 5? Do you know how to compute the square of a number?
Use a for loop.
Topic archived. No new replies allowed.