From the germinating moong seeds in the flask. Carbon dioxide is naturally present in very small quantities in the air; in the flask, additional carbon dioxide is produced by the seeds as they respire.
During respiration, glucose is broken down in the presence of oxygen, releasing carbon dioxide, water and energy:
Glucose + Oxygen → Carbon dioxide + Water + Energy
The energy produced is used by the plant for its growth and development — which is why soaked seeds sprout so vigorously.
Why the set-up is kept in the dark for 24 hours: in the dark the seeds cannot photosynthesise, so no carbon dioxide is used up. Everything collected in the flask is the product of respiration alone — that is what makes this a fair test of respiration.