When you subtract a multi-digit number from itself, the answer is always a multiple of nine (long explanation left out here) - and (one of the cool things about multiples of nine)if you add the digits together, that answer is also a multiple of nine. Their program just looks at the digits you typed in, then subtracts the sum of those digits from the next higher multiple of nine, and voila! Looks like magic, but it's just a cool math coincidence of base 10 mathematics (and a very simple program).

The reason they don't let you circle a "0" is because it'd be ambiguous - the remaining digit could be either a 0 or a 9, and they'd only have a 50% chance of being right, rather than 100%.

OK, Maybe I spent too much time paying attention in math classes or something...