the question does not present the picture, but this does not interfere with the resolution
we know that
perimeter square=4*b
where
b is the length side of the square
perimeter=40 cm
so
4*b=40
b=40/4
b=10 cm
Find the diagonal applying the Pythagoras Theorem
D²=b²+b²-----> D²=10²+10²----> D²=200-----> D=√200
D=10√2 cm
the answer is
the length of the diagonal is 10√2 cm