function res = productToN(n)
%!! Compute $\prod_{k=1}^n k$
res = 1;
%!! Set up the accumulator
for k=1:n
   res = res .* k;
   %!! Update the accumulator on each iteration
end
