Electronegativity is the tendency of an atom to attract the shared pair of electrons towards itself. Electronegativity increases across the period because the elements on the right need electrons to attain noble gas configuration and are smaller in size that makes the attraction between the nucleus and extra electrons stronger.
Fluorine is the most electronegative element.
Electron affinity is the amount of energy released when an electron is added to a neutral atom in gaseous state to form a negative anion. It also increases across the period and is highest for the halogens as they need only one electron to attain noble gas configuration, stability and hence release maximum energy when an electron is added to them.
​Chlorine has the highest electron electron affinity, more than as fluorine because fluorine being smaller in size has high electron density that results in a repulsion between the electron cloud and the added electron. This leads to decrease in the stability of the atom and lesser release of energy.