text: Find most significant set bit of a number | C # program to find MSB number for given n . ; To find the position of the most significant set bit ; To return the the value of the number with set bit at k - th position ; Driver code
code: using System ; public class GFG { static int setBitNumber ( int n ) { int k = ( int ) ( Math . Log ( n ) / Math . Log ( 2 ) ) ; return 1 << k ; } static public void Main ( ) { int n = 273 ; Console . WriteLine ( setBitNumber ( n ) ) ; } }