You can put this solution on YOUR website! You have to use pythagorean theorem:
a^2 + b^2 = c^2
Now you know that all the sides of a square are equal so all sides are 4cm long.
And the diagonal which you need to find is the hypotenuse so :
4^2 + 4^2 = c^2
16 + 16 = c^2
c^2 = 32
c = sqrt(32)
c = 5.65cm
Which you can round to:
c = 6cm
The diagonals length is equal to about 6cm.