Highest power of 2 that divides the LCM of first N Natural numbers . | C ++ implementation of the approach ; Function to find the highest power of 2 which divides LCM of first n natural numbers ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int highestPower ( int n ) { return log ( n ) / log ( 2 ) ; } int main ( ) { int n = 15 ; cout << highestPower ( n ) ; return 0 ; }