Number of digits before the decimal point in the division of two numbers | C # implementation of the approach ; Function to return the number of digits before the decimal in a / b ; Return the required count of digits ; Driver code
using System ; class GFG { public static int countDigits ( int a , int b ) { double digits = Math . Log10 ( Math . Abs ( a ) ) - Math . Log10 ( Math . Abs ( b ) ) + 1 ; return ( int ) Math . Floor ( digits ) ; } static void Main ( ) { int a = 100 ; int b = 10 ; Console . Write ( countDigits ( a , b ) ) ; } }