in reply to Adding and Multplying Elements in an Array

Since this is homework, I'm not gonna do it for you, but i'll give you a little hint. What value does $sum2 have before it enters the loop(or does it have a value). hmmm....