This solution is not correct - it exhibits a possible overflow error into 6 digits. Consider: 4 Random digits all come out as 9 (multiply by 10 = 99990), then add 10 you get 100000 which does not meet the requirements... The correct solution is: Generate a four digit random number Multiply it by 10 (to shift into correct position) Then randomly choose to make the last digit a 5 or a 0 (adding 10 is the incorrect step) The result is divisible by 5. Regards David.
M
mooman27
@mooman27