public static long addLongs(long i) { long added=0; while (i != 0) { added = added + (i%10); i = i - (i%10); i = i/10; } return added; }