Task

Write a program to find the sum of squares of a numeric vector.

The program should work on a zero-length vector (with an answer of   0).



Related task

   Mean


function SumOfSquares(sequence v)
    atom sum
    sum = 0
    for i = 1 to length(v) do
        sum += v[i]*v[i]
    end for
    return sum
end function