Because carbon atoms have 4 electrons in their outer shell so always form 4 covalent bonds in a molecule, so the number of hydrogen atoms bonded can be inferred by subtracting however many bonds the carbon is shown to have from 4:number of hydrogens = 4 - other bonds on that carbonWhereas other elements, such as oxygen, are able to form different numbers of bonds depending on their surroundings so the number of hydrogens bonded cannot be assumed.