The building, the ladder, and the ground form a right triangle as shown below:
The ladder is the hypotenuse of the triangle and the height H and the horizontal distance (3 ft) are the legs.
Applying the Pythagora's Theorem:
Solving for H:
The building is 10.58 feet tall