Sum of internal angles of a Polygon | C ++ implementation of the approach ; Function to return the sum of internal angles of an n - sided polygon ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int sumOfInternalAngles ( int n ) { if ( n < 3 ) return 0 ; return ( n - 2 ) * 180 ; } int main ( ) { int n = 5 ; cout << sumOfInternalAngles ( n ) ; return 0 ; }