Position of rightmost set bit | C # Code for Position of rightmost set bit ; Driver method
using System ; class GFG { public static int getFirstSetBitPos ( int n ) { return ( int ) ( ( Math . Log10 ( n & - n ) ) / Math . Log10 ( 2 ) ) + 1 ; } public static void Main ( ) { int n = 12 ; Console . WriteLine ( getFirstSetBitPos ( n ) ) ; } }