/* Program to find sum of digits of a 5 digit number, without recursion */ /* Problem 12 (a) */ #include #include main() { long num; int digit,sum; clrscr(); printf("Please enter a 5 digit number : "); scanf("%ld",&num); sum = 0; while (num >= 10) { digit = num % 10; num = num / 10; sum += digit; } sum += num; printf("\nThe sum of digits of the number is %d",sum); printf("\n\nPress any key to exit..."); getch(); }