Here,
The largest 5-digit number = 99999
To find the largest 5-digit number having the hundreds digit other than 9 and 7, hundreds digits needs to be replaced by 8.
So, the largest 5-digit number having the hundreds digit other than 9 and 7 = 99998
The second largest 5-digit number having the hundreds digit other than 9 and 7 = 99898