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.
- Host: GitHub
- URL: https://github.com/g3th/numbers_sum
- Owner: g3th
- Created: 2022-11-02T06:32:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T03:53:42.000Z (almost 4 years ago)
- Last Synced: 2025-12-09T16:56:56.452Z (8 months ago)
- Language: C++
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
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.