Calculate the sum of digits of a number
123
6
Time: 2s · Memory: 256 MB
Use a loop to extract each digit and sum them using modulus (%) and division (/).
> Run your code to see console output.