text: C # program to find highest power of 2 smaller than or equal to n .
code: using System ; class GFG { static int highestPowerof2 ( int n ) { int p = ( int ) ( Math . Log ( n ) / Math . Log ( 2 ) ) ; return ( int ) Math . Pow ( 2 , p ) ; }