C
Programming and Technical
Programming
Program
Find out the Factorial of an input no and no. of trelling zeros
example
input=5
output=
factrioal of the no is=120
no of tralling zero are=1
Read Solution (Total 3)
-
- #include
void main()
{
int fact=1,num,count=0;
printf("Enter the num==");
scanf("%d",&num);
while(num>0)
{
if(num==0)
fact=1;
else
fact=fact*num;
--num;
}
printf("fact===%d",fact);
while(fact>0)
{
if(fact%10==0)
{
count++;
}
fact=fact/10;
}
printf("ncount==%d",count);
} - 10 years agoHelpfull: Yes(4) No(0)
- #include
#include
int main()
{
int i,fact=1,num,count=0;
printf("Enter the num==");
scanf("%d",&num);
for(i=1;i0)
{
if(fact%10==0)
{
count++;
}
fact=fact/10;
}
printf("ncount==%d",count);
getch();
}
- 10 years agoHelpfull: Yes(0) No(0)
- int main()
{
int i,fact=1,n,count=0;
printf("Enter the num==");
scanf("%d",&n);
for(i=1;i0)
{
if(fact%10==0)
{
count++;
}
fact=fact/10;
}
printf("ncount==%d",count);
getch();
}
- 10 years agoHelpfull: Yes(0) No(0)
C Other Question