This program takes a user-input integer as input, initializes a variable to store the sum, and uses a while loop to extract each digit by modulo 10 and add it to the running sum. It then prints the final sum of digits for the input number.
This program takes a user-input integer as input, initializes a variable to store the sum, and uses a while loop to extract each digit by modulo 10 and add it to the running sum. It then prints the final sum of digits for the input number.
This program takes a user-input integer as input, initializes a variable to store the sum, and uses a while loop to extract each digit by modulo 10 and add it to the running sum. It then prints the final sum of digits for the input number.