Question: 2. Use recursion to write a method to calculate the sum of a positive integer's digit(s) entered by a user. The class name is:
2. Use recursion to write a method to calculate the sum of a positive integer's digit(s) entered by a user. The class name is: Final_P2. Sample Input and Output: Enter a positive integer: 500 The sum of digits of that number is 5. Enter a positive integer: 67013 The sum of digits of that number is 17.
Step by Step Solution
3.39 Rating (161 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
