Exactly. Because you have not defined the storage for array z[ ] correctly, anything you put in z[ ] will start overwriting other variables like, for instance, variable e.
Try this. As far as I can see, you actually need only 6 bytes to hold those 5 binary digits.
char z[ 10 ] = { 0 } ;