Number of triangles formed by joining vertices of n | Function to find the number of triangles ; print the number of triangles ; initialize the number of sides of a polygon
function findTriangles ( n ) { var num ; num = n * ( n - 4 ) ; document . write ( num ) ; } var n ; n = 6 ; findTriangles ( n ) ;