May 27, 2023
program to use find the product of digits of any number in c language
#include <stdio.h>
int main()
{
int n, prod = 1, rem;
printf("enter a number : ");
scanf("%d", &n);
while (n > 0)
{
rem = n % 10;
prod *= rem;
n /= 10;
}
printf("product of digits = %d\n", prod);
return 0;
}
output
enter a number : 166
product of digits = 36
by : Ajaj Khan
Quick Summary:
program to use find the product of digits of any number in c language copy #include <stdio.h> int main() { int n, prod = 1, rem; printf(“enter a number : “); scanf(“%d”, &n); while (n > 0) { rem = n % 10; prod *= rem; n /= 10; } printf(“product of digits = %d\n”, […]