Count total bits in a number | C # program to find total bit in given number ; log function in base 2 take only integer part ; Driver code
using System ; class GFG { static uint countBits ( uint number ) { return ( uint ) Math . Log ( number , 2.0 ) + 1 ; } public static void Main ( ) { uint num = 65 ; Console . WriteLine ( countBits ( num ) ) ; } }