When sunlight is available, the plant uses that energy to perform photosynthesis. In order to use this food for energy, the plant must perform cellular respiration. As long as there is sunlight both photosynthesis and respiration can take place in day time. At night there is no photosynthesis, so they give out carbon dioxide due to respiration.