Error in simple i2c wire communication code

1. Which Arduino is your Slave device? UNO or NANO or MEGA?
2. Show connection diagram that you have made between NANO and UNO/NANO/MRGA. Check that your connection is something similar to Fig-1 below.


Figure-1:

IDE ----> Tools ----> Board:  -----> Arduino AVR Boards ------> Arduino Nano
IDE ----> Tools -----> Processor : "ATmega328P" ----> ATmmega328P (Old Bootloader)