Carbon and silicon have same number of valance electrons which is 4 electrons.
Valance electrons are the electrons present in the outermost shell of the atom. The number of valance electrons define the valancy of the atom.
Now, Barium is a 2nd group element. So, it has two valance electrons.
Silicon is a 16th group element and it has 4 valance electrons as does the carbon. This is because they both stay in the same group in the periodic table.
Neon is a noble gas which has 8 valance electrons and stays in the 18th group.
Therefore, carbon and silicon have same number of valance electrons which is 4 electrons.
For more details, refer the link:
link