Use the Pythagorean Theorem:

where a and b are the legs of the right triangle, and c is the hypotenuse (longest side!).
There is no picture provided with the problem, so it might be possible for the right angle to be at C and the hypotenuse is AB. But that won't work with the answer choices given, because then

Now you know that the 7 must be a leg and 8 the hypotenuse. Then

.
By the way, it cannot be that 7 is the hypotenuse because it's the longest side and 8 is longer.