Wrong number of digits of a factorial number

I want to calculate number of digits of a factorial so that in my function i do not return the size of array. but my code is calcuating number of digigts wrong

@piyush.bansal8158625 hey piyush this can be done using only a count variable you don’t need to hard code it

If i only want to the digits of a factorial then how does my code is leading wrong result.Only the digits part i am talking about i.e. log (i) from i=1 to n .

@piyush.bansal8158625 hey piyush there is problem with your data type when you choose int size your result would be wrong declare size as float