(i) There are only five even digits: 0, 2, 4, 6 and 8. Five different even digits must be exactly these, and their sum is 0+2+4+6+8=20. A multiple of 9 must have a digit sum that is a multiple of 9, and 20 is not (20=18+2). So no such code exists.
(ii) 18=2×9, and 2 and 9 have no common factor other than 1, so the code must be divisible by 2 and by 9.
- By 2: the last digit is even, which is automatic because every digit is even.
- By 9: the digit sum must be a multiple of 9. Every digit is at least 2, so the sum is at least 5×2=10; a sum of even digits is even; so the sum must be 18 or 36. The smallest code uses the smaller sum, 18.
Now make the digits from the left as small as possible. Try 2 for the first three digits: they use 2+2+2=6, so the last two digits must add up to 12. The fourth digit cannot be 2 (the last digit would have to be 10), so the smallest choice is 4, and then the last digit is 8. Starting with 2222 is impossible for the same reason. The smallest code is 22248.
Check: 2+2+2+4+8=18 and 22248=18×1236.