#include <stdio.h>
int c, i, n, digit_cnt = 0, cnt = 0, total = 0;
int main(void)
{
while (c = getchar())
{
if (c == 'E')
break;
++cnt;
if (c >= '0' && c <= '9')
++digit_cnt;
}
i = -5;
n = 50;
while (i < n)
{
++i;
if (i == 0)
continue;
total += i;
printf("i = %d and total = %d\n", i, total);
}
return 0;
}
I want to avoid using breaks and continues, what are some ways to make these two pieces of codes work the same without using any breaks and continues?