Navidliverpool / Algorithm-Sum-of-Digits---Digital-Root

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Algorithm-Sum-of-Digits---Digital-Root is the recursive sum of all the digits in a number.

Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. The input will be a non-negative integer.

Examples

132189 --> 1 + 3 + 2 + 1 + 8 + 9 = 24 --> 2 + 4 = 6

942 --> 9 + 4 + 2 = 15 --> 1 + 5 = 6

About


Languages

Language:C# 100.0%