Count Digit
Example of Countdigit
public class Main {
public static void main(String[] args) {
int number =12344;
int digit=countDigit(number);
System.out.println(digit);
}
public static int countDigit(int n){
int cnt=0;
while(n>0){
cnt++;
n/=10;
}
return cnt;
}
}