Compare code segment 1 and 2 that are designed to produce the same results.
Segment 1:
sum ? 0
FOR EACH num IN numList
{
sum ? sum + num
}
DISPLAY (sum)
Segment 2:
sum ? 0
i ? 0
REPEAT LENGTH(numList) - 1 TIMES
{
sum ? sum + numList[i+1]
i ? i + 1
}
DISPLAY (sum)
Which of the following statements is true?