Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

no. of zeros in a factorial

$
0
0
#include <iostream>

using namespace std;

int main()
{   
    long int n,sum=0;
    cin>>n;
    long int k=n;
    while(k>=5)
    {
    k=k/5;
    sum=sum+k;
    }
    cout<<sum<<endl;
    return 0;
}

Nothing wrong here??


Viewing all articles
Browse latest Browse all 40121

Trending Articles