Need to store a 2 master passwords into the EEPROM of arduino for my project.

My code:

#include <EEPROM.h>
int zz;
int EEsize = 1024; // size in bytes of your board's EEPROM

int pass[4] = {1,2,3,4};
int pass1[5] = {7,8,9,10,11};

void setup()
{
 Serial.begin(9600);
}
void loop()

{
 Serial.println("Writing random numbers...");
 for (int i = 0; i < 4; i++)
 {
  
   EEPROM.write(i, pass[i]);
 }
 for(int j=0;j <5; j++ )
 {
   for(int k =4; k<9; k++)
   {
   EEPROM.write(k,pass1[j]);
 }
 }
 Serial.println();


 for (int a=0; a<EEsize; a++)
 {
   zz = EEPROM.read(a);
   Serial.print("EEPROM position: ");
   Serial.print(a);
   Serial.print(" contains ");
   Serial.println(zz);
   delay(2500);
 }
}

I am using this code to enter 2 different passwords into the locations of EEPROM so that they can be retrieved from the memory by another sketch which checks the password and decided whether the door has to be locked or not. The 1st array is getting updated, but only the last element of 2nd array is getting stored in the memory. Sorry, if it is a silly programming mistake.

Please help me with this. I am attaching a screenshot of the serial monitor output.

Thanks in advance.

memory error.png

You have posted code without using code tags. This creates certain problems and obstacles for other forum members. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click.
If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the [code] and [/code] metatags.

Also, you can cut and paste the printout, instead of making it an image, so people can read it more easily.

When you are finished that, please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question ...

  for (int j = 0; j < 5; j++ )
  {
    for (int k = 4; k < 9; k++)
    {
      EEPROM.write(k, pass1[j]);
    }
  }

Why the nested for loops ?

for (int j = 0; j < 5; j++ )
{
  EEPROM.write(j + 4, pass1[j]);
}

Why are the arrays ints when the maximum value that they hold is 255 ?

...and what is a zz?

aarg:
...and what is a zz?

It's a kind of top.

PaulS:
It's a kind of top.

http://www.zztop.com/

I didn't know that. Come to think of it, I probably still won't know it in a couple of hours from now.

void loop()
{
 Serial.println("Writing random numbers...");
 for (int i = 0; i < 4; i++)
 {
   EEPROM.write(i, pass[i]);
 }

You are going to wear out your EEPROM really quickly doing that. I suggest putting the writes into setup, not loop.