Jump to content

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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.