public class sum { public static void main(int a) { int b =0; int c =0; for (int i = a ; i>0 ; i=i/10) { b = i%10; c = c+b; } System.out.println(c); } }