Answers for "suma de digitos"

C
0

suma de digitos

//Recursive function to find sum of digits of a number
int sumOfDigits(int num){
    // Base condition
    if(num == 0){
        return 0;
    }

    return ((num % 10) + sumOfDigits(num / 10));
}
Posted by: Guest on July-09-2020

Code answers related to "C"

Browse Popular Code Answers by Language