Is there anyway to keep the code inside arduino after powering it off instead of having to reprogram it each time I switch it on?
It does retain the last sketch you loaded.
Daniel_74:
Is there anyway to keep the code inside arduino after powering it off instead of having to reprogram it each time I switch it on?
What makes you think that it does not do that anyway ?
When code is uploaded the code is written to flash (non-volatile) memory so the code is persistent (still exists after reset). Data generated by the program that is in SRAM is not persistent so if one wants that data to be available after reset the data must be saved to non-volatile memory (EEPROM, SD card, etc.) prior to reset and retrieved after reset.