x = [2,4,5]
n = length(x);

y = x(1);
z = y;

for i=2:n
    y = y+x(i);
    z = z*y;
end

disp('and the answer is...')
z