I have the following code which calculates the number of trailing zeroes in factorial of a number. The program runs for the first testcase which is 10 but when the same code is run for 17 it shows a SIGFPE error in C? Can anyone tell where i am going wrong?
#include<stdio.h>
#include<math.h>
int main(){
int n,i=1,j,sum=0,l;
scanf("%d",&n);
while((n/(5^i))>1)
{
j=(n/(5^i));
i++;
sum=sum+j;
}
printf("%d",sum);
return 0;
}