Sum and product of an array: Difference between revisions
→{{header|UNIX Shell}}: Use an actual array
(Sum and Product of an Array in Rapira) |
(→{{header|UNIX Shell}}: Use an actual array) |
||
Line 3,002:
echo $sum $prod</lang>
{{works with|
{{works with|Korn Shell}}
{{works with|Zsh}}
Using an actual array variable:
<lang bash>
for
done
printf '%d\t%d\n' "$sum" "$prod"
</lang>
{{Out}}
<pre>42 800</pre>
=={{header|UnixPipes}}==
|