According to law of definite proportion:
In a compound, elements are always arranged in fixed ratio by mass.
Here, sample 1 has 23.22 g Carbon and 32.00 g Oxygen.
Converting mass into number of moles:
Molar mass of carbon is 12 g/mol and that of oxygen is 16 g/mol thus,
![n_{C}=\frac{m_{C}}{M_{C}}=\frac{24.22 g}{12 g/mol}\approx 2 mol](https://tex.z-dn.net/?f=n_%7BC%7D%3D%5Cfrac%7Bm_%7BC%7D%7D%7BM_%7BC%7D%7D%3D%5Cfrac%7B24.22%20g%7D%7B12%20g%2Fmol%7D%5Capprox%202%20mol)
Similarly, number of moles of oxygen will be:
![n_{O}=\frac{m_{O}}{M_{O}}=\frac{32 g}{16 g/mol}=2 mol](https://tex.z-dn.net/?f=n_%7BO%7D%3D%5Cfrac%7Bm_%7BO%7D%7D%7BM_%7BO%7D%7D%3D%5Cfrac%7B32%20g%7D%7B16%20g%2Fmol%7D%3D2%20mol)
The ratio of number of moles of carbon and oxygen will be:
![C:O=n_{C}:n_{O}=2:2=1:1](https://tex.z-dn.net/?f=C%3AO%3Dn_%7BC%7D%3An_%7BO%7D%3D2%3A2%3D1%3A1)
Therefore, formula of compound will be CO.
Sample 2:
It has 36.22 g Carbon and 48.00 g Oxygen.
Converting mass into number of moles:
Molar mass of carbon is 12 g/mol and that of oxygen is 16 g/mol thus,
![n_{C}=\frac{m_{C}}{M_{C}}=\frac{36.22 g}{12 g/mol}\approx 3 mol](https://tex.z-dn.net/?f=n_%7BC%7D%3D%5Cfrac%7Bm_%7BC%7D%7D%7BM_%7BC%7D%7D%3D%5Cfrac%7B36.22%20g%7D%7B12%20g%2Fmol%7D%5Capprox%203%20mol)
Similarly, number of moles of oxygen will be:
![n_{O}=\frac{m_{O}}{M_{O}}=\frac{48 g}{16 g/mol}=3 mol](https://tex.z-dn.net/?f=n_%7BO%7D%3D%5Cfrac%7Bm_%7BO%7D%7D%7BM_%7BO%7D%7D%3D%5Cfrac%7B48%20g%7D%7B16%20g%2Fmol%7D%3D3%20mol)
The ratio of number of moles of carbon and oxygen will be:
![C:O=n_{C}:n_{O}=3:3=1:1](https://tex.z-dn.net/?f=C%3AO%3Dn_%7BC%7D%3An_%7BO%7D%3D3%3A3%3D1%3A1)
The formula of compound will be CO.
Therefore, it is proved that carbon and oxygen are present in fixed ratios in both the samples.