Nitrogen has lower electron affinity than its preceeding element carbon because
Nitrogen atom has half filled p-orbital
In general, electron affinity value becomes less negative with the increasing atomic radius because the electrostatic force of attraction decreases between the electron being added and the nucleus due to an increase of distance between them
When atomic radius increases, electron affinity decreases.
This is because the effective nuclear charge reduces on the electron being added because the distance is increasing.
Electron gain enthalpy α 1Atomic size
Now, we know that
N < C [Atomic radius]
But N has half-filled p-orbital which is very stable.
Adding an electron will not be easy to N because of the presence of a half-filled orbital.
Now, in case N, C and O.
It should be O > N > C [EA]
Because C > N > O [Atomic Radius]
But, nitrogen has half filled p-orbital which is very stable, therefore it would not like to add one electron to its configuration.
Therefore, carbon has lowest electron affinity.