According to the question,

Perimeter of square = Perimeter of rectangle

⇒ 4 x side = 2 (length + breadth)

⇒ 4 x side = 2 (40 + 22) ⇒ 4 x side = 2 x 62

⇒ side = (2 x 62)/4 = 31 cm

Thus, the side of the square is 31 cm.

Now, Area of rectangle = length x breadth = 40 x 22 = 880 cm^{2}

And Area of square = side x side = 31 x 31 = 961 cm^{2}

Therefore, on comparing, the area of square is greater than that of rectangle.