For this Question: Find number of digits in the factorial of a number n.First line consists of a single integer denoting n
1 <= n <= 100000Output a single line containing number of digits in factorial(n).Sample Input
5

Sample Output
3

Explanation:-
5!=120
number of digits = 3

Sample Input
10

Sample Output
7, I have written this Solution Code: #include <bits/stdc++.h>
// #define ll long long
using namespace std;

int findDigits(int n)
{
    // factorial exists only for n>=0
    if (n < 0)
        return 0;

    // base case
    if (n <= 1)
        return 1;

    // else iterate through n and calculate the
    // value
    double digits = 0;
    for (int i=2; i<=n; i++)
        digits += log10(i);

    return floor(digits) + 1;
}
int main()
{
    int t;
    t=1;
    while(t--){
int n;
cin>>n;
cout<<findDigits(n)<<endl;
}}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?