Practice ยท 3 of 4
Digit Sum
Implement int digit_sum(int n) summing the decimal digits of n (n >= 0). Use % 10 and / 10 in a loop.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Loop Gym
Practice ยท 3 of 4
Implement int digit_sum(int n) summing the decimal digits of n (n >= 0). Use % 10 and / 10 in a loop.
Difficulty: beginner
Back to lesson: Practice: Loop Gym