In the future, please enable warnings on your compiler. For example for GCC, this would be -Wall. 
main.cpp:7:29: warning: array subscript is above array bounds [-Warray-bounds]
         printf("%d\n",arr[5]); //here output: 2130567168
                             ^
main.cpp:8:30: warning: array subscript is above array bounds [-Warray-bounds]
         printf("%d\n",arr2[5]); //here output: 0
Note that the C standard says this is undefined behavior: 
§J.2
1 The behavior is undefined in the following circumstances:
— An array subscript is out of range, even if an object is apparently
  accessible with the given subscript (as in the lvalue expression
  a[1][7] given the declaration int a[4][5]) (6.5.6).
Receive your usual lecture about undefined behavior.