The formula that represents a hydrocarbon is [tex]C_5H_12[/tex]. Hence, option B is correct.
Hydrocarbons are compounds comprised exclusively of carbon and hydrogen.
Hydrocarbons are organic molecules consisting entirely of carbon and hydrogen.
In the given options only option 2 has carbon and hydrogen and rest all contain other than carbon and hydrogen atoms.
Hence, option B is correct.
Learn more about the hydrocarbon here:
https://brainly.com/question/16020705
#SPJ2