The molecular mass of C4H8O2 is:
(4 atoms of carbon) • (12 g/atomic mole) = 48 g/molecular mole
(8 atoms of carbon) • (1 g/atomic mole) = 8 g/molecular mole
(2 atoms of carbon) • (16 g/atomic mole) = 32 g/molecular mole
TOTAL = 88 g/mole_C4H8O2
(12.35 g_C4H8O2) ⁄ (88 g/mole_C4H8O2) = 0.14 moles_C4H8O2
For a more precise answer use the three exact atomic masses:
example: 12.0107 g/atomic mole_carbon
15.9994 g/atomic mole_oxygen
1.00794 g/atomic mole_hydrogen