Hydrocarbons are compounds that contain only carbon and hydrogen.
Carbon atoms can make four bonds each.
Hydrogen atoms can make one bond each.
To make a hydrocarbon, hydrogen atoms react with carbon atoms to form covalent bonds.
When this happens, carbon atoms share a pair of electrons with hydrogen atoms to make a covalent bond.
I HOPE YOU