We will use the Pythagorean Theorem to solve both cases.
Case 1: Given sides are both legs of the triangle:
3^2 + 4^2 = c^2
9 + 16 = 25 = c^2
c = 5
Case 2: Given sides are one leg and the hypotenuse:
a^2 + 3^2 = 4^2
a^2 = 4^2 - 3^2 = 16 - 9 = 7
a^2 = 7^(1/2)
The third side of the given right triangle could be five or the square root of seven.