Jump to content

Sum and product of an array: Difference between revisions

(PascalABC.NET)
 
Line 2,083:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">val .list = series 19
val alist = series(19)
writeln " list: ", .list
writeln " sumlist: ", fold fn{+}, .listalist
writeln "product sum: ", fold (fn{*+}, .listalist)
writeln "product: ", fold(fn{*}, alist)
</syntaxhighlight>
 
1,007

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.