Program to count digits in an integer ( 4 Different Methods ) | C # Code to count number of digits in an integer ; Driver Code
using System ; class GFG { static int countDigit ( long n ) { if ( n / 10 == 0 ) return 1 ; return 1 + countDigit ( n / 10 ) ; } public static void Main ( ) { long n = 345289467 ; Console . WriteLine ( " Number ▁ of ▁ " + " digits ▁ : ▁ " + countDigit ( n ) ) ; } }