If the penny stays in the child's stomach too long then the stomach acid could eventually dissolve the penny that is swallowed.
However most times the penny will pass through the stomach and intestines and come out in the poop without being dissolved.
Pennies aren't digested very good in the stomach like food is so the penny will most likely come out in the poop when the child poops.
My children have swallowed pennies before and it always came out in their poop in their diaper when I changed their diaper.
My son when he was 3 swallowed a penny so I took him to urgent care and they said that he should poop the penny out within 24 to 48 hours and the next day I changed his poop diaper and actually looked for it in the diaper and the penny was inside the poop in the diaper.
So if a child swallows a penny then they will poop it out the next day or so.