Thursday, August 28, 2008

Program to print its own source code as output

A Program which reproduces its own source code is called as a quine.
There are lots of ways to do this, here are some of them:

  • main(){char *c="main(){char *c=%c%s%c;printf(c,34,c,34);}";printf(c,34,c,34);}

main(){char*a="main(){char*a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";int b='"';printf(a

0 comments: