Any scalar expression in a condition explicitly converted to the bool type. If the value of the expression is equal to zero then it is converted to bool false. Otherwise it is converted to bool true.
So the expression arr[i] in the condition of the for loop checks whether it is true (not equal to zero) or false (equal to zero).
Your arrray has no element equal to zero. So the loop will continue even when the i will have value outside the acceptable values for indexes of the array.:)