Sum and product of an array: Difference between revisions

Content added Content deleted
(+Oz)
Line 365:
List.fold_left ( * ) 1 x
 
=={{header|Oz}}==
<pre>
functor
import
Application System
define
 
Print = System.showInfo
 
Arr = [1 2 3 4 5]
 
{Print {FoldL Arr Number.'+' 0}}
{Print {FoldL Arr Number.'*' 1}}
 
{Application.exit 0}
end
</pre>
=={{header|Perl}}==
my ($sum, $prod) = (0, 1);