Answer : The molecular formula of a caffeine is, 
Solution :
If percentage are given then we are taking total mass is 100 grams.
So, the mass of each element is equal to the percentage given.
Mass of C = 49.48 g
Mass of H = 5.19 g
Mass of N = 28.85 g
Mass of O = 16.48 g
Molar mass of C = 12 g/mole
Molar mass of H = 1 g/mole
Molar mass of N = 14 g/mole
Molar mass of O = 16 g/mole
Step 1 : convert given masses into moles.
Moles of C = 
Moles of H = 
Moles of N = 
Moles of O = 
Step 2 : For the mole ratio, divide each value of moles by the smallest number of moles calculated.
For C = 
For H = 
For N = 
For O = 
The ratio of C : H : N : O = 4 : 5 : 2 : 1
The mole ratio of the element is represented by subscripts in empirical formula.
The Empirical formula = 
The empirical formula weight = 4(12) + 5(1) + 2(14) + 16 = 97 gram/eq
Now we have to calculate the molecular formula of the compound.
Formula used :


Molecular formula = 
Therefore, the molecular of the caffeine is, 