I think when you do arr[5]={0};
Then it initializing arr[0]=0;
Now the rest element of array is intialised to zero, now for the bound of the array we now that the array is continuous memmory location that why it will keep on printing the next memory loction as you was doing after five iteration and the value of that memory called garbage (not needed for us),so i think c programming does perform array bound checking