What if we have a zero in between?

I was concerned that if there is a zero in between then the iterations will stop, so should the length of the number be considered in the loop?

@nehauppal9
loop will not stop if there is a zero in between because terminating condition is n!=0
which does not mean that if n%10==0 we stop

1 Like