* Ionic bonds form between a metal and a nonmetal, where one atom (the metal) loses electrons to become a positively charged ion (cation) and the other atom (the nonmetal) gains electrons to become a negatively charged ion (anion). These oppositely charged ions then attract each other, forming the ionic bond.
* Covalent bonds form when two nonmetals share electrons. Both atoms involved in the bond "want" to gain electrons to achieve a full outer shell. They achieve this by sharing electrons, creating a more stable arrangement.
In carbon monoxide:
* Both carbon and oxygen are nonmetals.
* They share electrons to form a triple bond.
Therefore, carbon monoxide is a covalent compound.