You can add the numbers in the array [6,7,29] using a loop.
1. [ VB ] Accumulate the sum of an array
1. [ Python ] Accumulate the sum of an array
1. [ C++ ] Accumulate the sum of an array
1. [ Java ] Accumulate the sum of an array
The for loop can be used to run through an array of
integers.
test text
1. [ C# ] Accumulate the sum of an array
The for loop can be used to run through an array of
integers.
test text
1. [ Perl ] Accumulate the sum of an array
1. [ Ruby ] Accumulate the sum of an array
An alternative:
a = [6,7,29]
puts a.inject(0){|b,i| b+i}
test text