Electron affinity is the enthalpy change when one electron is gained by an isolated gaseous atom in its valence shell.
X(g) + e- X-(g)
Electronegativity is the tendency to pull a shared pair of electrons towards itself. It means that if there is a bond between two atoms, the electron pair which is shared to form the bond , how much is the tendency of each atom to pull the shared electron pair towards itself is electronegativity.
You have rated this answer /10