Write a java program to find sum of digits of a number using recursion. Given a number, Write a java code to calculate sum of digits of a number using recursion.

For example –

Input number : 123

Output : 6 (1 + 2 + 3)

In my previous tutorial, I have explained how to find sum of digit of a number using iterative approach. In this tutorial, we are going to learn how we can do it using recursion.