C program to calculate and display the product of the input digit.
#include
<stdio.h>
#include<conio.h>
int
main()
{
int n, p=1;
printf("Enter any number: ");
scanf("%d", &n);
while(n != 0)
{
p = p * (n % 10);
n = n / 10;
}
printf("Product of digits = %ld",
p);
getch();
}
No comments:
Post a Comment