Write the number of diagonals of an n-sided polygon.

An n-sided polygon has n vertices.


By joining any two vertices of the polygon, we obtain either a side or a diagonal of the polygon.


Number of line segments obtained by joining the vertices of an n-sided polygon if we take two vertices at a time, number of


Ways of selection 2 out of n = nC2


Out of these lines, n lines are sides of the polygon.


Number of diagonals of the polygon =


nC2 – n – n


1