Java program to add digits of a number

Java program to add digits of a number

Output:

Enter a number to get sum of its digits: 1234
The sum of digits of number entered is: 10

Implementation: