We only need to look at the last digit.
7 ^ 1998 ^ 1999
The pattern of the units digit of 7
When exponent is divided by 4,
r1 r2 r3 r0
7 9 3 1
Take note that when we divide by 4 we only need to look at the last two digits.
When 1998 is divided by 4 we have a remainder of 2, 1999 we would have a remainder of 3.
Then the remainder of 1998*1999 when divided by 4 is (2*3)mod 4 = 6 mod 4 = 2 mod 4
Therefore the last digit would be 9.