* Nitrogen (N): Nitrogen is in Group 15 (also known as Group 5A) of the periodic table. Group numbers generally tell you the number of valence electrons for main group elements. So, nitrogen has 5 valence electrons.
* Carbon (C): Carbon is in Group 14 (also known as Group 4A) of the periodic table. Therefore, carbon has 4 valence electrons.