text: Seating arrangement of n boys and girls alternatively around a round table | C # program to find number of ways in which n boys and n girls can sit alternatively sound a round table . ; Get n ; find fac1 = ( n - 1 ) ! ; Find fac2 = n ! ; Find total number of ways ; Print the total number of ways
code: using System ; class GFG { long n = 5 ; long fac1 = 1 ; for ( int i = 2 ; i < = n - 1 ; ++ ) fac1 = fac1 * i ; long fac2 = fac1 * n ; long totalWays = fac1 * fac2 ; Console . WriteLine ( totalWays ) ; } }