When an atom from group 2 of the periodic table(say X) reacts with an atom of group 17(say Y), then the general formula is XY₂.
The elements present in group 2 of the periodic table (Be, Mg, Ca, Sr, Ba, Ra) are metals having valency 2. On the other hand, the elements present in group 17 ( F, Cl, Br, I, At, Ts) are halogens or non-metals having valency 1. So, elements from both these groups combine together by transfer of electrons, forming an ionic bond between them.
The general formula is formed by exchange of valencies.
here, valency of X=2, Y=1
Thus, the general formula is XY₂
To know more about general formula here
https://brainly.com/question/2492579
#SPJ4