LCM of factorial and its neighbors | function to calculate the factorial ; returning the factorial of the largest number in the given three consecutive numbers ; Driver code
function factorial ( n ) { if ( n == 0 ) return 1 ; return n * factorial ( n - 1 ) ; } function LCMOfNeighbourFact ( n ) { return factorial ( n + 1 ) ; } var N = 5 ; document . write ( LCMOfNeighbourFact ( N ) ) ;