At Westonci.ca, we connect you with the best answers from a community of experienced and knowledgeable individuals. Join our Q&A platform to get precise answers from experts in diverse fields and enhance your understanding. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

Consider the following code segment, which is intended to store ten consecutive even integers, beginning with 2, in the list evenList. Assume that evenList is initially empty.
i ← 1 REPEAT 10 TIMES
{ }

Which of the following can be used to replace so that the code segment works as intended?

A) APPEND(evenList, i)
i ← i + 2

B) i ← i + 2
APPEND(evenList, i)

C) APPEND(evenList, 2 * i)
i ← i + 1

D) i ← i + 1
APPEND(evenList, 2 * i)


Sagot :