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.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+918866008962>
"Helping hands are better than praying lips......"
ujjwal soni wrote:Here is source code of the C Program to display its own source code as its output.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+918866008962>
"Helping hands are better than praying lips......"
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 ).
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|