Here's why:
* Ionic Compounds: Formed when a metal atom loses electrons to a nonmetal atom, creating oppositely charged ions that attract each other.
* Covalent Compounds: Formed when nonmetal atoms share electrons to achieve a stable electron configuration.
In CO, both carbon and oxygen are nonmetals, and they share electrons to form a double bond.