Concept:The number of diagonals in a polygon with n sides is given by the formula 2n(n−3) or equivalently nC2−n.Explanation:An octagon has n=8 sides.A diagonal joins any two non-adjacent vertices.Total pairs of vertices are 8C2=28.Out of these, the 8 sides of the octagon are not diagonals.So subtract the sides: 28−8=20.Alternatively, apply the formula directly: 28×(8−3)=28×5=240=20.Answer:The correct option is D. 20.