Electronegativity: It can be defined as the tendency to attract the shared pair of electrons towards itself.
Non-metals are electronegative in nature. They contain 4 to 8 electrons in their outermost shell. As a result, they have tendency to accept or gain electrons to complete their octet.
Non-metals are formed as follows:
Therefore, the nonmetals are electronegative in nature, due to their tendency to gain electrons.