Calcium carbonate reacts with nitric acid. Explain how the two reactants determine the salt formed, and name the gas released.