Skip to content

Commit 7ec0aba

Browse files
committed
"Factorial Trailing Zeroes"
1 parent 4ef8297 commit 7ec0aba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/172.c

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdio.h>
2+
3+
int trailingZeroes(int n) {
4+
int c = 0;
5+
while (n) {
6+
n /= 5;
7+
c += n;
8+
}
9+
return c;
10+
}
11+
12+
int main() {
13+
printf("%d\n", trailingZeroes(1808548329));
14+
return 0;
15+
}

0 commit comments

Comments
 (0)