Skip to content

Instantly share code, notes, and snippets.

@ciupicri
Created March 7, 2013 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciupicri/5111952 to your computer and use it in GitHub Desktop.
Save ciupicri/5111952 to your computer and use it in GitHub Desktop.
My first quine
#include <stdio.h>
int main()
{
char n='\n',b='\\',q='"';
char *fmt="#include <stdio.h>%cint main()%c{%cchar n='%cn',b='%c%c',q='%c';%cchar *fmt=%c%s%c;%cprintf(fmt,n,n,n,b,b,b,q,n,q,fmt,q,n,n,n);%c}%c";
printf(fmt,n,n,n,b,b,b,q,n,q,fmt,q,n,n,n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment