C Program for Finding Trailing Zero's in factorial of Given number

 

Source Code :- 

#include<stdio.h>

int ftz(int a){

    int cnt = 0;

    for(int i = 5; a/i>=1; i *= 5){

        cnt += a/i;

    }

    return cnt;

}

int main(){

    int a;

    scanf("%d",&a); //60

    printf("%d",ftz(a)); //60

}


explanation:-



Comments

Popular posts from this blog

Learn Ethical Hacking From Scratch , Worth : 99.99 US Dollars Course For Free

Create a Fake login page of any website using super phisher