int trailingZeroes(int A) {

int i;

int factorial = A;

for (i = A; i <= 2; i–)

{

factorial = factorial * (i - 1);

}

```
int j = 0;
int a;
while (factorial / 10 != 0)
{
a = factorial % 10;
if (a == 0)
j++;
else
return j;
}
```

}

int trailingZeroes(int A) {

int i;

int factorial = A;

for (i = A; i <= 2; i–)

{

factorial = factorial * (i - 1);

}

```
int j = 0;
int a;
while (factorial / 10 != 0)
{
a = factorial % 10;
if (a == 0)
j++;
else
return j;
}
```

}

issues: 1) overflow of variable factorial in case of large value of A.

2)it runs in O(n) time complexity and will give TLE.