Let the base of the given right triangle be ‘x’ cm.

∴ Its height = (x – 7) cm

Squaring both sides, we get

169 = x^{2} + (x – 7)^{2}

⇒ 169 = x^{2} + x^{2} – 14x + 49

⇒ 14x + 49 – 169 = 0

⇒ 2x^{2 }– 14x – 120 = 0

⇒ x^{2} – 7x – 60 = 0

⇒ x^{2} – 12x + 5x – 60 = 0

⇒ x (x – 12) + 5 (x – 12) 0

⇒ (x–12) (x + 5) = 0

Either x –12 = 0 ⇒ x=12

or x + 5 = 0 ⇒ x = –5

But the side of triangle can never be negative,

⇒ x = 12

∴ Length of the base = 12 cm

⇒ Length of the height = (12 – 7) cm = 5 cm

Thus, the required base = 12 cm and height = 5 cm,