Due Date: 6/22/2025 11:59 PM
- Write a program to find the sum of each digit in a given number using recursion.
- Create a method named
sumOfNumbers(int value)
that takes 12345
as an input.
- Use all three steps to check recursion conditions.
- Use
12345
as the input.
- For example, if the number is
12345
, the sum should be 1+2+3+4+5 = 15
.
- Output: "The sum of 12345 = 15 using recursion"
How to Submit the Lab?
- Add your full name and email at the top of the file using a comment tag.
- Compile and run your program, entering the required inputs.
- Take a screenshot of the result.
- Zip your project with the source code and upload it to Blackboard.
- Upload the screenshot to Blackboard.
-
Note: Submit the assignment on Blackboard by the due date. Email submissions and late submissions will not be accepted.