Finding number of trailing zero in factorial-
#include <stdio.h> int main() { int n,total,deno; scanf("%d",&n); total=0; deno=5; while(deno<=n) { total+=n/deno; deno*=5; } printf("%d\n",total); return 0; }
No comments:
Post a Comment