#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c;
b=1;
a=0;
scanf("%d", &a);
while (a>0)
{
c=a%10;
if (c==0)
b=b*1;
else {
b=b*(a%10);
a=a/10;
}
}
printf("Proizvedenie: %d\n", b);
return 0;
}
It doesnt work when I add 0 in any position of number, but i added if and dont know why it doesnt work, cycle just does not end, pls help
01234 - 24; Right
1234 - 24; Right
12304 - doesnt work
12340 - doesnt work
WHY PLS HELP =(