An open API service indexing awesome lists of open source software.

https://github.com/g3th/numbers_sum

Enter a number and it returns the sum of all its single digits.
https://github.com/g3th/numbers_sum

Last synced: 4 months ago
JSON representation

Enter a number and it returns the sum of all its single digits.

Awesome Lists containing this project

README

          

## Numbers Sum
## Add all numbers in a given number
### Uses two different methods of obtaining the result.

Enter a number (i.e. 123) and the sum of all numbers is returned (i.e. 6).

The first code snippet will return the result by obtaining the numbers as string indexes.

The second code will return the result by recursion, using division and mod.