Skip to content

Commit 18bce39

Browse files
committed
count the number of trailing zeros in a number c-basics
1 parent 04ef682 commit 18bce39

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

countertrailingzeros.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include<stdio.h>
2+
void main()
3+
{
4+
int i=0,n;
5+
printf("Enter the number");
6+
scanf("%d",&n);
7+
while(n%10==0)
8+
{
9+
i++;
10+
n=n/10;
11+
}
12+
printf("%d",i);
13+
}

0 commit comments

Comments
 (0)