According to the question,
Perimeter of square$$=$$Perimeter of rectangle
$$\Rightarrow 4\times$$ side$$=2($$length$$+$$breadth$$)$$
$$\Rightarrow 4\times$$side$$=2(40+22)$$
$$\Rightarrow 4\times$$side$$=2\times 62$$
$$\Rightarrow$$ side$$=\dfrac{2\times 62}{4}=31$$cm
Thus, the side of the square is $$31$$cm.
Now, Area of rectangle$$=$$length$$\times$$breadth$$=40\times 22=880cm^2$$
And Area of square$$=$$side$$\times$$side$$=31\times 31=961cm^2$$
Therefore, on comparing, the area of square is greater than that of rectangle.