Finding the sum of array elements
There are two ways to find the sum of all array elements, 1) traverse/access each element and add the elements in a variable sum, and finally, print the sum. And, 2) find the sum of array elements using sum() function.
arr = [10, 20, 30, 40, 50]
sum = 150