Sodium chloride (NaCl) is the chemical name for table salt and potassium chloride (KCl) is a common salt substitute. Using the periodic table, choose the correct statement about how these compounds form.

A. Both sodium and potassium atoms gain electrons to form ions.
B. Sodium and potassium lose electrons and chlorine gains them.
C. Chlorine gains electrons from potassium and loses electrons to sodium.
D. Chlorine gains more electrons from potassium than it does from sodium.