$(i)\,Cl\xrightarrow{E.A.}Cl^-\,\,\,\,\,\,(ii)\,C{{l}^{-}}\xrightarrow{I.E.}Cl\,\,\,\,(iii)\,\,Cl\xrightarrow{I.E.}C{{l}^{+}}\,\,\,(iv)\,\,C{{l}^{+}}\xrightarrow{I.E.}Cl^{2+}$
Electron affinity is the amount of energy released when one electron is gained by an ion or atom.
$Cl \longrightarrow Cl ^{-} \text {E.A.=-X }$
$Cl ^{-} \rightarrow Cl\, I.E. \,=+X$
Thus, magnitude of $I.E.$ and $E.A.$ is same for the above process because same amount of energy is required or released to add an electron in $Cl$ or to remove an electron from $Cl ^{-}$.
Thus, $\mid\, I.E.$ of process$(ii) \,|=| \,E.A.$ of process$(i)\,\mid$