Why weren't the moles of oxygen calculated the same way as C? Combustion analysis of a $\rm1.500~g$ sample of ascorbic acid yields $4.023\rm~g$ of $\ce{CO2}$ and $\rm0.96~g$ of $\ce{H2O}$. What is the empirical formula of ascorbic acid?


Actually my question is that in many solutions I saw it's solved like that:

In $\ce{CO2}$ the moles of C is calculated as $$\frac{4.023}{44.02}=0.9139\rm~mass=1.0976~g$$

and the $\ce{H2O}$ is solved with getting out the H moles with same way that C was solved and the mass is
$$\rm m~H=0.10761~g$$
 the mass of O will be $$\rm 1.500-(0.10761~g-1.0976~g)=0.29489~g~moles=0.1842$$
My question is why didnt we use the same procedure we did with H and C to compute the moles with O? Why did we make it in the last step?
You have done combustion analysis, so you have introduced a large amount of oxygen to the ascorbic acid sample.  Because of this, you can't know how much of the oxygen in the $\ce{CO2}$ and $\ce{H2O}$ you produced actually came from the acid sample and how much came from the atmosphere.

But you do know that the mass of your ascorbic acid is the mass of all the carbon plus the mass of all the hydrogen, which you calculated, plus the mass of oxygen.  The difference in mass between what you have calculated and what you started with is the mass of oxygen that was in the ascorbic acid.

If there were any other elements in your sample, such as sulphur or nitrogen, those amounts would also have to be calculated before finally working out how much mass you haven't accounted for which must have been oxygen.