Calculate Sum of Digits in a Number
This snippet defines a function `findSumOfDigits` that calculates the sum of the digits of a given number. It uses a while loop to extract each digit by taking the modulus and then reduces the number by dividing it. Finally, it logs the sum of the digits of the number 77.Leave a Comment