Combustion of any hrdrocarbon yields carbon dioxide and water such that the hydrogen and carbon are derived from the hydrocarbon.
1 mole of carbon dioxide has a mass out of which 12 g is the mass of carbon, therefore, 3.38 g of carbon will contain (3.38 × 12)/44 = 0.922 g of carbon.
Thus, since the hydrocarbon has a mass of 1 g, then the mass of hydrogen will be (1-0.922 g) = 0.078 g.
To get the empirical formula we divide the mass of each element by the atomic mass to get the number of moles.
Carbon= 0.922/12 = 0.0768 moles
Hydrogen = 0.078/1 = 0.078 moles
Then we get the ratio of the moles of carbon : hydrogen
= 0.0768 : 0.078
= 1 : 1.016
≈ 1: 1
Therefore the empirical formula of the hydrocarbon will be CH