Number of digits in N!

this is the problem statement:

https://practice.geeksforgeeks.org/problems/digits-in-factorial/1/?track=dsa-workshop-1-mathematics&batchId=308#

my soln:

https://ide.geeksforgeeks.org/lXsijC7ceq

its showing correct output for all the inputs i am trying,
but when submitted its showing sigsegv please help me out here,
i dont think there is any problem with logic,
please help me to find out whats the problem