Number of digits in N factorial to the power N | C # program to find count of digits in N factorial raised to N ; we take sum of logarithms as explained in the approach ; multiply the result with n ; Driver Code
using System ; class GFG { static int countDigits ( int n ) { double ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += Math . Log10 ( i ) ; ans = ans * n ; return 1 + ( int ) Math . Floor ( ans ) ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( countDigits ( n ) + " STRNEWLINE " ) ; } }