Wikipedia says it\'s called a quine and someone gave the code below:
char*s=\"char*s=%c%s%c;main(){printf(s,34,s,34);}\";main(){printf(s,34,s,34);}
>
#include
int main(void)
{
char a[20],ch;
FILE *fp;
// __FILE__ Macro will store File Name to the array a[20]
sprintf(a,__FILE__);
// Opening the file in Read mode
fp=fopen(a,"r");
// Taking character by character from file,
// you can also use fgets() to take line by line
while((ch=fgetc(fp))!=EOF)
printf("%c",ch);
return 0;
}