Contest Code:PRACTICE Problem Code:FCTRL what is wrong with my code?

https://www.codechef.com/viewsolution/51750352

well theres 2 things to this,

  1. in the first while loop, (line 6) u initialize fact = 1, hence everytime this loop runs your varible fact becomes 1, and overwriting the previously stored f
    with this done , onto a bigger problem
  2. in the example test code, they use a like 7 digit number and finding factorial for a number of this length sure does take a toll , so try finding alternative ways of doing this
    they got a youtube vid on this, just youtube the problem.
    untill next time

your logic is incorrect bro… for number of zeros in N! you have to divide N by 5 and record the quotient as A further divide A by 5 record the quotient as B and go on till final quotient is less than 5…later add up A, B, C…(all the quotient) and that will be your answer(number of trailing zeros in a factorial)