Sum the Digits

Write a static method that is passed an integer and returns the sum of the digits of that integer. You will need to use modulus inside a loop.

Preconditions:

Examples:

Files Needed




©2003–2016 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License