Can goto() statements be avoided in this program -- pls place code?

GolamMostafa:
This is a Keypad-LCD-EEPROM based academic project in which a 10-digit code (consisting of any combination of 0, 1, ..., 9) is entered. After the entry, # key will store the code in EEPROM; b key will bring back the code from EEPOM and will show on LCD; * key will delete the code from buffer and EEPROM.

Fig-1: Hardware Block Diagram


Fig-2: Flow hart for the Control Program

:Simple C Codes for Fig-2: (Tested and found working except filtering out of *, #, a, b, c, d from being printed)

#include<EEPROM.h>

#include<Keypad.h>
#include<LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

const byte rows = 4, cols = 4;
char storage[11];   //including space for null-byte
char storageB[11];
int adr = 0x0010;
int arrayTracker = 0;
byte flag11 = 0x00;
byte flag2 = 0x00;
byte flag3 = 0x00;
char input;

char keys[rows][cols] = {

{'1','2','3','a'},
{'4','5','6','b'},
{'7','8','9','c'},
{'*','0','#','d'}
};

byte rPins[rows] = {9,8,7,6}, cPins[cols] = {5,4,3,2};

Keypad keypad = Keypad(makeKeymap(keys),rPins,cPins,rows,cols);

void setup()
{
lcd.init();
lcd.backlight();
lcd.print("Enter 10-digit..");
lcd.setCursor(0,1);
}

void loop()
{
 L0: input = keypad.getKey(); //L0:
 if(input)
 {                         //L1:
   if(flag2==0x00)         //L1:
   {                 //L2:
     if(flag11==0x00)//L2:      
     {//L3:
       filterDigit();      //L3: do not print *, #, a, b, c, d
       lcd.write(input);   //show digit on LCD
       storage[arrayTracker] = input;  //save digit
       if(arrayTracker == 9)  //L4
       {//L5:
         arrayTracker++;       //L5
         storage[arrayTracker] = 0x00; //null-byte
         flag11 = 0x01;
         goto L0;
       }
       else
       {     //L5A:
         arrayTracker++;   //L5A:
         goto L0;
       }
     }
     else
     {          //L3A:
       if(input == '#')    //to save in EEPROM
       {   //L3Y:
         EEPROM.put(adr, storage); //save 10-digit code in EEPROM
         delay(1000);
         lcd.setCursor(0, 1);
         lcd.print("Saved in EEPROM");
         flag2 = 0x01;
         goto L0;    //L3Y:
       }
     }
     //----------L3 : if-else--------------------
   }

else
   {
     if(input == '*')      //L2A:
     {  //3X:
       //delete code from array and EEPROM
       for(int i=0; i<11; i++)
       {
         storage[i] = 0x00;
         storageB[i] = 0x00;
       }
       EEPROM.put(adr, storage);   //all digits are 0s
       lcd.clear();
       lcd.setCursor(0, 0);
       lcd.print("Codes Deleted!");
       lcd.setCursor(0, 1);
       EEPROM.get(adr, storageB);
       lcd.print(storageB);
       flag3 = 0x01;
       goto L0;
     }
     else  
     {  //L3XA:
       if(flag3 == 0x00)
       {  //L4X:
         if(input == 'b')
         {//L5X:
           //read from EEPROM and show on LCD
           EEPROM.get(adr, storageB);
           lcd.clear();
           lcd.setCursor(0, 0);
           lcd.print("Code from EEPROM");
           lcd.setCursor(0, 1);
           lcd.print(storageB);
         }
        }
      }
    }    
  }
}

void filterDigit()
{
 
}

Have you written any code using 'State Machine' techniques?

Or code that has functions other than setup() or loop()?

Do you know what a flag is and how it can be used to control code execution?

Have you ever used switch/case.