In a chemical reaction, the law of conservation of mass states that mass is neither created nor destroyed; it simply changes forms. This means that the total mass of the reactants must equal the total mass of the products.
In the given reaction:
\[ \text{CaCO}_3 \rightarrow \text{CO}_2 + \text{CaO} \]
If the scientist heats 30 grams of calcium carbonate (CaCO3), the total mass of the products (CO2 and CaO) will also be 30 grams.
Therefore, the correct response is:
30 grams