C program to find Product of digits a number
#include<stdio.h>
int main()
{
int num;
long long product=1;
printf("Enter Digit: ");
scanf("%d",&num);
while(num!=0)
{
product *= (num%10); //if product=0 then all value are 0
num = num/10;
}
printf("Product of Digits: %lld",product);
return 0;
}
Output
Enter Digit: 1234
Product of Digits: 24