title: Number of Trailing Zeros in a Factorial in c
body: <p>I am new to C programming
  I want to find out the number of trailing zeros in a Factorial of given number </p>
  
  <pre><code>{
          long int n=0,facto=1,ln=0;
          int zcount=0,i=1;
          printf("Enter a number:");
          scanf("%ld",&amp;n);
          if(n==0)
          {
            facto=1;
          }
          else
          {
             for(i=1;i&lt;=n;i++)
             {
                facto=facto*i;
             }
          }
          printf("%ld",facto);
          while(facto&gt;0)
          {
             ln=facto%10;
             facto/10;
             if(ln=!0)
             { 
                 break;
             }
             else
             { 
                 zcount+=1;
             }
          }
          printf("Tere are Total %d Trailing zeros in given factorial",zcount);
  }
  </code></pre>
  
  <p>I have tried to calculate the modulo of the the number which will return the last digit of given number as the remainder and then <code>n/10;</code> will remove the last number. </p>
  
  <p>After executing the program the output always shows number of trailing zeros as "0",The condition <code>if(ln =! 0)</code> always gets satisfied even if there is a zero.</p>