How to find the Last program loaded in Arduino ATMEGA328p

hi
I am new in this forum and with ARDUINO pl help.
how do i know which is the last program is loaded in my Arduino 328p
how to read the last code uploaded in the ATMEGA328p ? controller ?

how do i know which is the last program is loaded in my Arduino 328p

Put something in the program that identifies itself when the program runs. Then, just open the serial monitor to see.

how to read the last code uploaded in the ATMEGA328p ? controller ?

If you mean hex file, there is an avrdude function to do that. What do you intend to do with that binary file once you have retrieved it? "Edit it" is not one of your options.

yesterday I loaded my ARDUINO with led and Motor code's but today nether LED glows Nor the Motor is running
I don't know which program's were loaded in the ARDUINO
pl can any one help me find the same
thanks

The sketch loaded on the Arduino does not have a name. If you want it to display a name, you must assign it one, in the sketch, and you must print it in the sketch.

yesterday I loaded my ARDUINO with led and Motor code's but today nether LED glows Nor the Motor is running

So, load it again. If it still fails to work, you blew up your Arduino somehow.

HI
IF I LOAD THE NEW PROGRAM AGAIN IT WILL OVERWRITE IT AND IT WILL WORK .
MY QUESTION IS THAT
whether we can see the program loaded in the ATMEGA 328P on the pc
I have Arduino 1.0.1

Did you save your program before uploading?..

MY QUESTION IS THAT
whether we can see the program loaded in the ATMEGA 328P on the pc

I believe it is possible, using avrdude, to retrieve the binary code that is currently on the atmega. In theory, you could compile your possible sketches, then compare the binary files produced by the compiler to the one retrieved from the atmega. The sketch source code is not stored on the atmega.

If u uploaded a program now, and did not upload any new program after switching your arduino ON , the same program should still be their on the ON-chip memory,as its non-volatile and you can test it by checking your output...but i dont think u can retrieve the program once you upload any new program,as it does not save the sketches.