Sum of internal angles of a Polygon | Java implementation of the approach ; Function to return the sum of internal angles of an n - sided polygon ; Driver code
class GFG { static int sumOfInternalAngles ( int n ) { if ( n < 3 ) return 0 ; return ( ( n - 2 ) * 180 ) ; } public static void main ( String args [ ] ) { int n = 5 ; System . out . print ( sumOfInternalAngles ( n ) ) ; } }