Y m i getting wronr answer......

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int t,n,i,j,k,l,s=0;
scanf("%d",&t);
for(i=0;i<t;i++)
{
s=0;
scanf("%d",&n);
for(j=1;;j++)
{
if(n>=pow(5,j))
{
k=j;
}
else
{
break;
}
}
for(l=1;l<=k;l++)
{
s=s+n/pow(5,l);
}
printf("%d",s);
}
return 0;
}//program to find no. of zeros at the end of factorial of a no.

Please write ur code properly …or give an ideone linke of your program…

See This link.
In your code you were not printing answer for each case in the new line so i changed it ans now your code is giving TLE. See this.

2 Likes

Thanks a lot

okk,sorry for this.