The number of diagonals in a polygon of \(n\) sides is \(\frac {n(n-3)}{2}\). For example: In quadrilateral we know that there are two diagonals.
Now, put \(n=4\) in the formula \(\frac {n(n-3)}{2}\),
\(=\frac {4(4-3)}{2}\)
\(=\frac {4\times1}{2}\)
\(=2\)
Take another example: we know that in a pentagon number of diagonals are \(5\).Now, put \(n=5\) in the formula \(\frac {n(n-3)}{2}\),
\(=\frac {5(5-3)}{2}\)
\(=\frac {5\times 2}{2}\)
\(=5\).
So, the number of diagonals in a polygon of \(n\) sides is \(\frac {n(n-3)}{2}\).