Seating arrangement of N boys sitting around a round table such that two particular boys sit together | C ++ implementation of the approach ; Function to return the total count of ways ; Find ( n - 1 ) factorial ; Return ( n - 1 ) ! * 2 ! ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int Total_Ways ( int n ) { int fac = 1 ; for ( int i = 2 ; i <= n - 1 ; i ++ ) { fac = fac * i ; } return ( fac * 2 ) ; } int main ( ) { int n = 5 ; cout << Total_Ways ( n ) ; return 0 ; }