Is carbon dioxide given off during photosynthesis and respiration?

It is given off during respiration but I don't know about photosynthesis. I think oxygen is actually given off by photosynthesis.