In the photosynthesis reaction, 6 carbon atoms combine. The overall equation for photosynthesis can be summarized as:
\[ 6 \text{CO}_2 + 6 \text{H}_2\text{O} \rightarrow \text{C}6\text{H}{12}\text{O}_6 + 6 \text{O}_2 \]
This indicates that 6 molecules of carbon dioxide (each containing 1 carbon atom) are used, resulting in the production of one molecule of glucose (which contains 6 carbon atoms). So the correct answer is 6.