
-----------------------------------
scorpion1087
Tue Oct 14, 2003 5:26 pm

array total
-----------------------------------
how do you add the numbers in an array together?

(im trying to find the average)

-----------------------------------
Blade
Tue Oct 14, 2003 5:49 pm


-----------------------------------
you need a variable to keep the total of the array, then you add each element in the array to the total

var total:int:=0
var nums:array 1..10 of int

%initialize your array here

for i:1..10
  total += nums(i)
end for

glad to see you finally posted...
