Content
num2 – temp (D) num1 – num2 num2 num1 23. A programmer wants to write code which will evaluate each number from 1 to 30 and determine whether it is an odd number. Odd numbers will be added to the list oddNum and displayed. Evaluate the 2 code segments below to determine whether they will output the correct list. Code Segment 1 Code Segment 2 oddNum number 1 REPEAT 30 TIMES oddNum – number 1 REPEAT 30 TIMES IF (number MOD 2 1) IF (number MOD 2 0) oddNum number number APPEND (oddNum, number 1) number – number 1 number – number DISPLAY (oddNum) DISPLAY (oddNum) (A) Both code segments will correctly add all even numbers from 1 to 30 to the list. (B) Only Code segment 1 will correctly add all even numbers from 1 to 30 to the list. (C) Only Code segment 2 will correctly add all even numbers from 1 to 30 to the list. (D) Neither code segment will correctly add all even numbers from 1 to 30 to the list.