Sum of internal angles of a Polygon | Function to return the sum of internal angles of an n - sided polygon ; Driver code
< ? php function sumOfInternalAngles ( $ n ) { if ( $ n < 3 ) return 0 ; return ( ( $ n - 2 ) * 180 ) ; } $ n = 5 ; echo ( sumOfInternalAngles ( $ n ) ) ; ? >