Seating arrangement of n boys and girls alternatively around a round table | Get n ; find fac1 = ( n - 1 ) ! ; Find fac2 = n ! ; Find total number of ways ; Print the total number of ways
< ? php $ n = 5 ; $ fac1 = 1 ; for ( $ i = 2 ; $ i <= $ n - 1 ; $ i ++ ) $ fac1 = $ fac1 * $ i ; $ fac2 = $ fac1 * $ n ; $ totalWays = $ fac1 * $ fac2 ; echo $ totalWays . " STRNEWLINE " ;