I have an array of twenty integers, and I’d like to find the sum of all the integers. The obvious way is
var sum:int = arr[0]+arr[1]+arr[2]… etc.
I’m wondering if there’s a shortcut way of adding the elements up? Many thanks.
I have an array of twenty integers, and I’d like to find the sum of all the integers. The obvious way is
var sum:int = arr[0]+arr[1]+arr[2]… etc.
I’m wondering if there’s a shortcut way of adding the elements up? Many thanks.
:: Copyright KIRUPA 2024 //--