Anonymous user
Sum and product of an array: Difference between revisions
+ AutoHotkey
(+ AutoHotkey) |
|||
Line 109:
set product to product * i
end repeat
=={{header|AutoHotkey}}==
<lang AutoHotkey>
numbers = 1,2,3,4,5
product := 1
loop, parse, numbers, `,
{
sum += A_LoopField
product *= A_LoopField
}
msgbox, sum = %sum%`nproduct = %product%
</lang>
=={{header|AWK}}==
|