problem in programming

dear Sirs

I have a problem with my new arduino board MEGA 2560.

when I upload my program it works carefully and everything is ok

but when I disconnect usb cable from board its memory is erased and I have to upload it again.

What should I do for it to hold the program even when the board disconnects from power supply.

thanking you in advance.

Normally the uploaded program remains on the Arduino when you disconnect the USB cable.

How do you know that is not happening ?
What tests have you done ?