@@ -0,0 +1,480 @@
+import java.util.Scanner;  %0Apublic class SumOfAllDigits %7B  %0A    public static void main(String args%5B%5D) %7B  %0A        int number, digit, s = 0;  %0A%0A        System.out.print(%22Enter a number: %22);  %0A        Scanner sc = new Scanner(System.in);  %0A        number = sc.nextInt();%0A%0A        while(number %3E 0) %7B  %0A            digit = number %25 10;  %0A            s = s + digit;  %0A            number = number / 10;  %0A        %7D  %0A        System.out.println(%22Sum of all digits: %22 +s);  %0A    %7D  %0A%7D  

Sum of digits in Java