Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Problem of the day

You are given an integer N, you need to find the number of trailing zeroes in N! (N factorial).

Note:

```
1. Trailing zeros in a number can be defined as the number of continuous suffix zeros starting from the zeroth place of a number.
2. For example, if a number X = 1009000, then the number of trailing zeros = 3 where the zeroth place is 0, the tenth place is 0, the hundredth place is 0.
3. ! means “FACTORIAL”. Factorial of a number is calculated by the product of the integer and all integers below it till 1.
4. Value of 0! is 1.
```

Detailed explanation

```
1 <= T <= 10^4
1 <= N <= 10^9
Time Limit: 1sec
```

```
1
5
```

```
1
```

```
The value of 5! is calculated as 5 * 4 * 3 * 2 * 1 = 120. 120 has 1 trailing zero.
```

```
2
3
2147
```

```
0
534
```