A strong electrolyte like MgCl2 dissociates completely as per the following reaction:
[tex]MgCl_2 ----\ \textgreater \ Mg^{2+} + 2Cl^-[/tex]
As you can see, from 1 molecule of MgCl2 produces 3 ions on dissociation.
So, 1 mole of MgCl2 produces 3 moles of ions.
Now, Moles of MgCl2 = Volume x Molarity
= 0.04 x 0.345 [Change volume to Litres]
= 0.0138 moles
Now, total moles of ions = 0.0138 x 3 = 0.0414