Question 50 of 65Pseudocodepseudocode mod division

What will be the output of the following pseudocode?

Note: / is integer division
Integer n, d, r
Set n = 3854, r = 0
while (n > 0)
    d = n mod 10
    if (d mod 2 == 0)
        r = r * 10 + d
    End if
    n = n / 10
End while
Print r

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 this full mock in the real exam interface.

Log in to see the answer
← Q49Q51 →Attempt the full timed mock