Seating arrangement of N boys sitting around a round table such that two particular boys sit together | Function to return the total count of ways ; Find ( n - 1 ) factorial ; Return ( n - 1 ) ! * 2 ! ; Driver code
function Total_Ways ( n ) { var fac = 1 ; for ( i = 2 ; i <= n - 1 ; i ++ ) { fac = fac * i ; } return ( fac * 2 ) ; } var n = 5 ; document . write ( Total_Ways ( n ) ) ;