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


        define('ssq(a)i') :(ssq_end)
ssq     i = i + 1; ssq = ssq + (a<i> * a<i>) :s(sumsq)f(return)
ssq_end
 
*       # Fill array, test and display
        str = '1 2 3 5 7 11 13 17 19 23'; a = array(10)
loop    i = i + 1; str len(p) span('0123456789') . a<i> @p :s(loop)
        output = str ' -> ' sumsq(a)
end