Find the maximum number of handshakes | C ++ program to find maximum number of handshakes . ; Calculating the maximum number of handshake using derived formula . ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int maxHandshake ( int n ) { return ( n * ( n - 1 ) ) / 2 ; } int main ( ) { int n = 10 ; cout << maxHandshake ( n ) << endl ; return 0 ; }