A 45 g sample of a ketose with a general formula CnH2nOn gives 18.45 liter of CO2 at 27C and 2 atm and 27 g of water when burned. If 1.204 x 10 23 molecules of this ketose weigh 30 g, what are its molecular and structural formulas ?

Use PV = nRT to calculate moles from the CO2 data, then conert moles CO2 to moles C, then to g carbon and finally to percent C in the 45 g sample.

The 27 g H2O can be converted to g H an to percent H in the 45 g sample. Oxygen is tbe difference between 100 - (C + H).
Take a 100 g sample to obtain, if my figures are ok,
40 g C.
6.66 g H.
53.34 g O.

Convert each of the grams to moles.
Find the ratio of the moles to each other. The easiest way to do that is to divide the smaller value by itself which gives 1.000 for that number; then divide the other numbers by the same small number. Round all to a whole number. This will give you the empirical formula. CxHyOz.

The other data determines the molar mass. You know the mass of 1.204 x 10^23 molecules. The molar mass will contain 6.02 x 10^23 molecules.
molar mass/empirical mass CxHyOz. Round to a whole number (call it w) and the molecular formula is (CxHyOz)w