Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

add digits java

    public static int sumDigits(int number){
        if (number < 10) return -1;
        int sum = 0;
        while (number > 10){
             sum += number % 10;
            number /= 10;
        }
        return sum + number;
Source by www.udemy.com #
 
PREVIOUS NEXT
Tagged: #add #digits #java
ADD COMMENT
Topic
Name
5+7 =