During photosynthesis, carbon dioxide is taken in by the plant, and water is split to produce glucose and oxygen in the presence of sunlight and chlorophyll.