Question: Write a method that takes a four-digit integer value and returns the sum of the digits. For example, given the number 7631, the method should
Write a method that takes a four-digit integer value and returns the sum of the digits. For example, given the number 7631, the method should return 17. Incorporate the method into an application that reads a value from the user and displays the result.
Step by Step Solution
3.31 Rating (151 Votes )
There are 3 Steps involved in it
Sure this problem can be solved easily in many programming languages but Ill provide a solution usin... View full answer
Get step-by-step solutions from verified subject matter experts
