I'll talk about Cellular Respiration first.
So Cellular Respiration is basically Glycolysis (or Oxidative decarboxylation of Pyruvate) -> Citric Acid Cycle (TCA) -> Electron Transport/ATP Formation (Oxidative Phosphorylation)
What you're interested in is the Citric Acid Cycle - you will have a net gain of 6 NADH, 2 FADH2 and 2 GTP
Now, when these go through the electron transport chain, they will basically be oxidised to NAD+, FAD2+
So the reaction for NADH would be: NADH -> NAD+ H+ + e-
The electron is then transferred to oxygen, the proton is pushed into the middle of the mitochondrion membrane, where it estabishes a charge gradient and hence, will force itself back down ATP Synthase which will hence, produce ATP.
I have no idea regarding photosynthesis, I don't do plant biology.