Sum and product of an array
my @ary = 1, 5, 10, 100;
say 'Sum: ', [+] @ary;
say 'Product: ', [*] @ary;Last updated
Was this helpful?
my @ary = 1, 5, 10, 100;
say 'Sum: ', [+] @ary;
say 'Product: ', [*] @ary;Last updated
Was this helpful?
Was this helpful?