We do this by dividing the given mass of each element by its molar mass.
For carbon, we have $\frac{0.2990 \, \text{g}}{12.01 \, \text{g/mol}} = 0.0249 \, \text{mol}$.
For hydrogen, we have $\frac{0.05849 \, \text{g}}{1.01 \, \text{g/mol}} = 0.0579 \,
Show more…