break inside while loop

closed account (SG15Nwbp)
1
2
3
4
5
6
7
8
while(n>0){
    int check=n%10;
    if(check==0)
        ???????
    if(n%check==0)
        divi++;

}


how would we stay inside this while loop at the same time leaving the if (check==0) loop if that condition is hit? like instead of break; because i dont want to exit the while loop. i tried continue; but i got error for that.
continue should work just fine.
Or you could do this:

1
2
3
4
5
    while (n > 0) {
        int check = n % 10;
        if (check && n % check == 0)
            divi++;
    }

Topic archived. No new replies allowed.