Pythagoras' theroem states that on a right-angle triangle, the square of the longest side (hypothenus) is equal to the sum of the squares of the other two sides.
Therefore, H2 = A2 + B2
52 = 32 + B2
25 = 9 + B2
B2 = 25 - 9
B = Square root(16)
B = 4 cm