If the two sides with length 3 and 4 are the two legs, then the missing side, i.e. the hypotenuse, is indeed 5.
But it could also be the case that 4 is the hypotenuse and 3 is one of the legs. In this case, the missing side is the other leg, so we calculate it using
So, a right triangle with legs and 3 has an hypotenuse of 4.