First, add a reference to <EEPROM.h> at the start of your sketch:
#include <EEPROM.h>
Then your other code:
// Stores value in a particular address in EEPROM. There are almost 512 addresses present.
// Store value 24 to Address 0 in EEPROM
int addr = 0;
int val = 24...