package org.example; import java.util.Scanner; public class Week1Q6 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter a number between 0 and 100: "); int num = scan.nextInt(); int sum = 0; while (num > 0){ int digit = num % 10; sum += digit; num /= 10; } System.out.println("The sum of the digits is " + sum); } }