Number of digits in 2 raised to power n | C # program to find number of digits in 2 ^ n ; Function to find number of digits in 2 ^ n ; Driver code
using System ; class GFG { static int countDigits ( int n ) { return ( int ) ( n * Math . Log10 ( 2 ) + 1 ) ; } static void Main ( ) { int n = 5 ; Console . Write ( countDigits ( n ) ) ; } }