For example, the molecular formula for water is H2O, which shows that there are two hydrogen atoms and one oxygen atom in a water molecule.