It depends on what the "ideal" angle is.. the angle that it's propped up against the wall.
A small angle < 45° will get more height but falling backwards off the ladder is more probable. An angle > 45° get's much less height and get's more unsafe the closer to 90° it becomes. I guess you should go with 45° as the ideal angle.
Then the ladder just makes a right triangle with the building.
Opposite side is the height, Hypotenuse is the ladder length.
Soh Cah Toa
Sin(45°) = (height) / (10 ft)
10 × Sin(45°) = height
7.07 ft