Respuesta :

Ionic bonding occurs when metal atom combines with non-metal atoms.
The metal atom becomes a cation as it loses electrons.
The non-metal atom becomes an anion as it gains electrons.
Electrons are gained or lost to obtain an octet or duplet electronic configuration.
Example: Sodium chloride where sodium is a metal and chlorine is a non-metal. Sodium ion has a charge of +1 as it loses one electron to chlorine. While chlorine has a charge of -1 as it gains an electron from sodium. 

Covalent bonding occurs when non-metals combine with non-metals.
Covalent compounds share electrons. 
Example: Carbon dioxide. Both are non-metals.
Carbon has an electronic configuration of (2,4)
Oxygen has an electronic configuration of (2, 6)
Hence, carbon shares 4 electrons with 2 oxygen atoms. This is because carbon needs 4 more electrons, hence it has to share 4 electrons. Oxygen requires only 2, hence both oxygen atoms share 2 electrons each.