Manhattan Associates Interview Question

write a recursive program to add digits of a number.

Interview Answer

Anonymous

Apr 20, 2019

private static int calculateSum(int input) { if(input == 0) { return 0; } return (input % 10 + calculateSum(input/10)); }