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


( ( sumOfSquares
  =   sum component
    .   0:?sum
      &   whl
        ' ( !arg:%?component ?arg
          & !component^2+!sum:?sum
          )
      & !sum
  )
& out$(sumOfSquares$(3 4))
& out$(sumOfSquares$(3 4 i*5))
& out$(sumOfSquares$(a b c))
);