To write the greatest 6-digit number having three different digits, we will
have to use three largest digits. Clearly 9, 8 and 7 are three largest digits. In
order to write the largest 6-digit number using digits 7, 8 and 9, we put the
largest digit 9 at the place having the highest place value. The smallest digit
7 is put at the right most place i.e. at unit's place and the digit 8 is put at the
ten's place. All other places are filled by 9.
Hence, the required number = 999987.