int main(void) { int i; int array[5]; for (i = 0; i <= 20; i++) array[i] = 0; return 0; }
Why is the above code stuck in a
You are invoking undefined behaviour by overwriting beyond the memory you are allowed. So anything can happen.
Most likely, it's overwriting the loop counter.