Ulf Dittmer wrote:You should resist the temptation to follow the link Matthew posted, but instead try to do it yourself. The learning effect of doing it yourself far surpasses the knowledge gained by being told how to do it.
Jay Orsaw wrote:I don't know why people would want to do that, but okay.... :p.
Ulf Dittmer wrote:To take the challenge one step further (and make the resulting source code even more obscure), try to write the shortest source code that prints itself. I think I have seen a Java solution that does this in less than 200 characters.
ujjwal soni wrote:Here is source code of the C Program to display its own source code as its output.
ujjwal soni wrote:Yes, it will work
(You can also write a program that reads its own source code and prints it out, but I believe that's considered cheating ).