Step-by-step explanation:
It is known that the atomic number of magnesium is 12 and its electronic distribution is 2, 8, 2. And, in order to attain stability a magnesium atom will tend to lose its valence electrons.
That is, being a metal magnesium atom will lose its 2 valence electrons and hence it forms a
ion.
Equation for this type of loss is as follows.
![Mg \rightarrow Mg^(2+) + 2e^(-)](https://img.qammunity.org/2021/formulas/chemistry/college/qy4nirwtorfw2wbdrs64soxhnyle17awie.png)
Therefore, we can conclude that the charge of the ion formed by the
atom is +2.