As the object was initially placed 20 cm in front of the plane mirror, the image formed was 40 cm away from the original object. Now, when the mirror is moved 2 centimeters towards the object, the image also moves two towards the object. In this perspective, the distance of the image from the mirror will be 18+18, which is 36.
Now forty minus thirty-six is 4 centimeters, which simply defines the distance between the original and the final mirror images. You need to keep the image distance in mind and also include the distance that image moved in order to calculate the correct answer.