A has the electronic configuration as 2, 8, 8, 1. It can readily lose an electron to attain electronic configuration of argon.
B has the electronic configuration as 2, 8, 7. It can readily take an electron to attain electronic configuration of neon.
So, A will lose an electron to B and form an ionic bond.
A is Potassium and B is chlorine. The formula for the product will be KCl.