Since there are many hydrocarbons, we'll work with the most common one, methane. Methane's formula is:
![CH_(4)](https://img.qammunity.org/2019/formulas/chemistry/college/39zo8nw91sst17oqi16kd60buati70h1d2.png)
Which means there are 4 hydrogen atoms to every carbon atom.
If there are 50 hydrogen atoms:
50 / 4 = 12,5 ≈ 13 carbon atoms.
Hope it helped,
BioTeacher