Question 19 of 110Programming Basicspseudocode

Consider the following pseudocode carefully and trace its execution step by step. What will be printed when this pseudocode is executed?

SET even TO 0
SET odd TO 0
FOR EACH x IN THE LIST [8, 3, 12, 5, 10, 7]
    IF x MOD 2 EQUALS 0 THEN
        SET even TO even + x
    ELSE
        SET odd TO odd + x
    END IF
END FOR
PRINT even - odd

The verified answer and full solution are one login away

Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.

Log in to see the answer
← Q18Q20Attempt the full timed mock

More pseudocode questions