// Program by Akash Tripathi (@proakash256)
// 0 comes because of multiplying 2 and 5.
// So we count the number 5's in the number
// by dividing it with perfect
// multiples of 5.
#include <stdio.h>
int main()
{
int n , res = 0;
printf("Enter the Number : ");
scanf("%d" , &n);
for(int i = 5; i <= n; i = i * 5)
{
res = res + (n / i);
}
printf("\nThe Number of Trailing Zeroes
in %d is %d\n\n" , n , res);
return 0;
}
Comments
Post a Comment