Let x be the base of the triangle, then the altitude will be (x−7).
By Pythagoras theorem,
x2+(x−7)2=(13)2
2x2−14x+49−169=0
2x2−14x−120=0
x2−7x−60=0
x2−12x+5x−60=0
(x−12)(x+5)=0
x=12,x=−5
Since the side of the triangle cannot be negative, so the base of the triangle is 12cm and the altitude of the triangle will be 12−7=5cm.