I have a doubt regarding memory allocation to the arrays in C. Like in this snippet I assigned the array size 4 but in the next line, I accessed a location that is not part of the array but still there is no error in execution.I don't understand how it is working.
int main()
{ int arr[4];
arr[5] = 35;
printf("%d\n",arr[5]);
return 0;
}