Which is the function of stomata

The function of stomata is to regulate the exchange of gases between the plant and the atmosphere. Stomata open to allow the plant to take in carbon dioxide for photosynthesis and release oxygen, and close to prevent water loss.