Since there are many hydrocarbons, we'll work with the most common one, methane. Methane's formula is:

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