#include <stdio.h>int main() {// Declare variablesint num, sum = 0, digit;// Ask the user for a 5-digit numberprintf("Enter a 5-digit number: ");scanf("%d", &num);// Process the number until it becomes 0while (num != 0) {// Get the last digit of the numberdigit = num % 10;// Add the digit to the sumsum = sum + digit;// Remove the last digit from the numbernum = num / 10;}// Output the sum of the digitsprintf("Sum of digits = %d\n", sum);return 0;}