Let the ladder be AB and BC be the height of the window from the ground.
We have:
AB 10 m and BC = 8 m
Applying theorem in right-angled triangle ACB, we have:
AB2 = AC2 + BC2
⇒ AC2 = AB2 − BC2 = 102 − 82 = 100 − 64 = 36
⇒ AC = 6 m
Hence, the ladder is 6 m away from the base of the wall.