function res = prodk(v,k)

p = 1;

if k == 0
    res = 1;
else
for j = 2:k
    p = p*v(j-1);
end
end

res = p;

end

