Atomic number of any element is equal to protons present in atom.
Hence atomic number = number of protons= 12
Atomic mass is sum of protons and neutrons present in atom.
Therefore mass number = number of protons (p) + number of neutrons (n) = 12 + 12 = 24