Maximum LCM among all pairs ( i , j ) of first N natural numbers | C ++ implementation of the approach ; Function to return the maximum LCM among all the pairs ( i , j ) of first n natural numbers ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int maxLCM ( int n ) { return ( n * ( n - 1 ) ) ; } int main ( ) { int n = 3 ; cout << maxLCM ( n ) ; return 0 ; }