Number of digits in the product of two numbers | C # Code for Number of digits in the product of two numbers ; function to count number of digits in the product of two numbers ; if either of the number is 0 , then product will be 0 ; required count of digits ; Driver code
using System ; class GFG { public static int countDigits ( int a , int b ) { if ( a == 0 b == 0 ) return 1 ; return ( int ) Math . Floor ( Math . Log10 ( Math . Abs ( a ) ) + Math . Log10 ( Math . Abs ( b ) ) ) + 1 ; } static void Main ( ) { int a = 33 ; int b = - 24 ; Console . Write ( countDigits ( a , b ) ) ; } }