So this is my code so far.
public int getsum (int n){ int num = 23456; int total = 0; while (num != 0) { total += num
public static int digitSum (int n) { int r = n%10; //remainder, last digit of the number int num = n/10; //the rest of the number without the last digit if(num == 0) { return n; } else { return digitSum (num) + r; }}