Seating arrangement of n boys and girls alternatively around a round table | Driver Code ; Get n ; find fac1 = ( n - 1 ) ! ; Find fac2 = n ! ; Find total number of ways ; Print the total number of ways
public static void Main ( ) { let n = 5 ; let fac1 = 1 ; for ( let i = 2 ; i <= n - 1 ; i ++ ) fac1 = fac1 * i ; fac2 = fac1 * n ; totalWays = fac1 * fac2 ; document . write ( totalWays + " " ) ;