Molarity is defined as the number of moles of solute dissolved in a volume of 1 L.
the number of moles of CaCl₂ present - 12 mol
Volume of solution - 3 L
Therefore if 3 L contains 12 mol of CaCl₂
then 1 L of CaCl₂ contains -

= 4 mol/L
Therefore molarity of CaCl₂ is 4 M