Computer Science Canada

array total

Author:  scorpion1087 [ Tue Oct 14, 2003 5:26 pm ]
Post subject:  array total

how do you add the numbers in an array together?

(im trying to find the average)

Author:  Blade [ Tue Oct 14, 2003 5:49 pm ]
Post subject: 

you need a variable to keep the total of the array, then you add each element in the array to the total

code:
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...


: