title: How can we find big O notation for trailing zeros in factorial?
body: <p>I know how to calculate big O notation for factorial but I am having difficulty combining both notations.
  this is the code for calculating trailing zeros.</p>
  
  <pre><code>using namespace std;
  
    // Function to return trailing 
    // 0s in factorial of n
   int findTrailingZeros(int n)
   {
     // Initialize result
      int count = 0;
  
      // Keep dividing n by powers of 
      // 5 and update count
      for (int i = 5; n / i &gt;= 1; i *= 5)
          count += n / i;
  
      return count;
  }
  
  // Driver Code
  int main()
  {
     int n = 100;
     cout &lt;&lt; "Count of trailing 0s in " &lt;&lt; 100
          &lt;&lt; "! is " &lt;&lt; findTrailingZeros(n);
     return 0;
  }
  </code></pre>