C: Accessing other memory location addresses that we shouldn’t be

When I try to access memory addresses which are not within the scope of string s, here are some result as below.

address9: s[4], s[5], and s[6] shows “%”, “c”, and ” “.
address10: s[4], s[5], and s[6] same as address9.
address11: s[4], s[5], and s[6] same as address9.

The address 9, 10 and 11 shown the same char output on s[4], s[5], and s[6] even through they are from different codes.

As for accessing location outside of array, it will result as below.

address12.1: Outside of array will result of 0, 0, 0… -354..
address12.1: Outside of array will result of 0, 0, 0… -190…

There is a random – 354… and -190…. It could be know as segmentation fault.