In a neutral atom, atomic number represents the number of protons inside the nucleus and equal number of electrons around it. Therefore, the number of total electrons in molecule of CO2​ = electrons present in one carbon atom +2 × electrons present in one oxygen atom =6+2×8=22.