Think about how you add up. Suppose I ask you to add the
number in the series 2,6,9. you don't go let me put the numbers into
an array. you simply keep a running total,
So in your case
start a total
total=0
then IF the number is >0 add to total
divide total by the number of >0 numbers (or 42 ;-)
Just because it is programming it doesn't mean that you can forget you kindergarden maths.
Reputation Points: 749
Solved Threads: 134
Practically a Master Poster
Offline 660 posts
since Nov 2008