write a C function which takes a natural number as argument and calculates the product of sum of its digits. A sum-product number is natural number that equals the product of sum of its digits and the product of digits.

well, the hardest part is picking off the digits of the number. That is easily done by taking the remainder when dividing by 10.

So, if the number is n, this can be achieved by the following loop:

int n,d;
d=0;
while (n > 0) {
d = n%10;
#now you have the ones' digit #use it for the sum and product
n /= 10; # integer division
}

I'm sure you can fill in the rest.

Sure! Here's an example of a C function that calculates the product of the sum of the digits of a given natural number:

```c
#include <stdio.h>

int sumDigits(int number) {
int sum = 0;

while (number > 0) {
int digit = number % 10;
sum += digit;
number /= 10;
}

return sum;
}

int calculateProduct(int number) {
int sum = sumDigits(number); // Calculate the sum of the digits

int product = 1;

while (number > 0) {
int digit = number % 10;
product *= digit;
number /= 10;
}

return sum * product; // Return the product of the sum and product of digits
}

int main() {
int number;
printf("Enter a natural number: ");
scanf("%d", &number);

int result = calculateProduct(number);
printf("Result: %d\n", result);

return 0;
}
```

To explain the logic behind this function:

1. The `sumDigits` function is used to calculate the sum of the digits of a given number. It iterates through the number using a while loop and extracts each digit by using the modulo operator `%`. The digit is then added to the `sum` variable. Finally, the number is divided by 10 to move on to the next digit.

2. The `calculateProduct` function takes the input number and calculates the product of the sum of the digits and the product of the digits. It first calls the `sumDigits` function to calculate the sum. Then, it uses a similar while loop to iterate through the number and calculate the product of the digits. The product is continuously multiplied by the digits extracted from the number.

3. Finally, the main function prompts the user to enter a natural number, calls the `calculateProduct` function to get the result, and prints it out.

Hope this helps!