In both photosynthesis and chemosynthesis:
carbon dioxide and oxygen are produced. carbohydrates are produced. oxygen is produced. carbon dioxide is produced.
In both photosynthesis and chemosynthesis, carbohydrates are produced.
While both processes produce carbohydrates, the specific byproducts (like oxygen in photosynthesis) differ.