How to write a program which prints 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,b,a,b,b);} You can find more such codes on the web if you search for quine, Here is an article written by Gary P.