text: Number of Hamiltonian cycle | C ++ program for implementation of the above program ; Function that calculates number of Hamiltonian cycle ; Calculating factorial ; Driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int Cycles ( int N ) { int fact = 1 , result = 0 ; result = N - 1 ; int i = result ; while ( i > 0 ) { fact = fact * i ; i -- ; } return fact / 2 ; } int main ( ) { int N = 5 ; int Number = Cycles ( N ) ; cout << " Hamiltonian ▁ cycles ▁ = ▁ " << Number ; return 0 ; }