Question 404480
The legs and the diagonal form a right angle.
The diagonal is the hypotenuse.
apply Pythagoras theorem
..
Let l be one leg. 
since it is a square the other leg is also l.

l^2+l^2= 40^2
2l^2=1600
l^2=800
l = sqrt (800)
l = 28.28
...
l= 28.3 cm