a program that prints itself is called a quine...so try searching "quines" on google and you can easily found what you are looking for ...

or you can go through the following links..

http://www.madore.org/~david/computers/quine.html
http://www.nyx.net/~gthompso/self_c.txt